public class ClientPreparedQuery extends AbstractQuery implements PreparedQuery
Query.CancelStatus
Modifier and Type | Field and Description |
---|---|
protected RuntimeProperty<java.lang.Boolean> |
autoClosePStmtStreams |
protected int |
batchCommandIndex
Command index of currently executing batch command.
|
protected java.lang.String |
originalSql
The SQL that was passed in to 'prepare'
|
protected int |
parameterCount
The number of parameters in this PreparedStatement
|
protected QueryBindings |
queryBindings |
protected QueryInfo |
queryInfo |
protected RuntimeProperty<java.lang.Boolean> |
useStreamLengthsInPrepStmts |
batchedArgs, cancelTimeoutMutex, charEncoding, clearWarningsCalled, currentDb, fetchSize, maxAllowedPacket, queryAttributesBindings, resultSetType, session, statementExecuting, statementId, timeoutInMillis
Constructor and Description |
---|
ClientPreparedQuery(NativeSession sess) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
asSql() |
void |
checkNullOrEmptyQuery(java.lang.String sql)
Method checkNullOrEmptyQuery.
|
void |
closeQuery() |
int |
computeBatchSize(int numBatchedArgs)
Computes the optimum number of batched parameter lists to send
without overflowing max_allowed_packet.
|
protected long[] |
computeMaxParameterSetSizeAndBatchSize(int numBatchedArgs)
Computes the maximum parameter set size, and entire batch size given
the number of arguments in the batch.
|
<M extends Message> |
fillSendPacket(QueryBindings bindings) |
int |
getBatchCommandIndex() |
java.lang.String |
getOriginalSql() |
int |
getParameterCount() |
QueryBindings |
getQueryBindings() |
QueryInfo |
getQueryInfo() |
void |
setBatchCommandIndex(int batchCommandIndex) |
void |
setOriginalSql(java.lang.String originalSql) |
void |
setParameterCount(int parameterCount) |
void |
setQueryBindings(QueryBindings queryBindings) |
void |
setQueryInfo(QueryInfo queryInfo) |
addBatch, checkCancelTimeout, clearBatchedArgs, getBatchedArgs, getCancelTimeoutMutex, getCurrentDatabase, getExecuteTime, getId, getQueryAttributesBindings, getResultFetchSize, getResultSetFactory, getResultType, getSession, getStatementExecuting, getTimeoutInMillis, isClearWarningsCalled, resetCancelledState, setCancelStatus, setClearWarningsCalled, setCurrentDatabase, setExecuteTime, setResultFetchSize, setResultType, setTimeoutInMillis, startQueryTimer, statementBegins, stopQueryTimer
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addBatch, checkCancelTimeout, clearBatchedArgs, getBatchedArgs, getCancelTimeoutMutex, getCurrentDatabase, getExecuteTime, getId, getQueryAttributesBindings, getResultFetchSize, getResultSetFactory, getResultType, getSession, getStatementExecuting, getTimeoutInMillis, isClearWarningsCalled, resetCancelledState, setCancelStatus, setClearWarningsCalled, setCurrentDatabase, setExecuteTime, setResultFetchSize, setResultType, setTimeoutInMillis, startQueryTimer, statementBegins, stopQueryTimer
protected QueryInfo queryInfo
protected QueryBindings queryBindings
protected java.lang.String originalSql
protected int parameterCount
protected int batchCommandIndex
protected RuntimeProperty<java.lang.Boolean> autoClosePStmtStreams
protected RuntimeProperty<java.lang.Boolean> useStreamLengthsInPrepStmts
public ClientPreparedQuery(NativeSession sess)
public void closeQuery()
closeQuery
in interface Query
closeQuery
in class AbstractQuery
public QueryInfo getQueryInfo()
getQueryInfo
in interface PreparedQuery
public void setQueryInfo(QueryInfo queryInfo)
setQueryInfo
in interface PreparedQuery
public java.lang.String getOriginalSql()
getOriginalSql
in interface PreparedQuery
public void setOriginalSql(java.lang.String originalSql)
setOriginalSql
in interface PreparedQuery
public int getParameterCount()
getParameterCount
in interface PreparedQuery
public void setParameterCount(int parameterCount)
setParameterCount
in interface PreparedQuery
public QueryBindings getQueryBindings()
getQueryBindings
in interface PreparedQuery
public void setQueryBindings(QueryBindings queryBindings)
setQueryBindings
in interface PreparedQuery
public int getBatchCommandIndex()
getBatchCommandIndex
in interface PreparedQuery
public void setBatchCommandIndex(int batchCommandIndex)
setBatchCommandIndex
in interface PreparedQuery
public int computeBatchSize(int numBatchedArgs)
computeBatchSize
in interface PreparedQuery
numBatchedArgs
- original batch sizepublic void checkNullOrEmptyQuery(java.lang.String sql)
checkNullOrEmptyQuery
in interface PreparedQuery
sql
- the SQL to checkWrongArgumentException
- if query is null or empty.public java.lang.String asSql()
asSql
in interface PreparedQuery
protected long[] computeMaxParameterSetSizeAndBatchSize(int numBatchedArgs)
numBatchedArgs
- number of batched argumentspublic <M extends Message> M fillSendPacket(QueryBindings bindings)
fillSendPacket
in interface PreparedQuery