public class ServerPreparedQuery extends AbstractPreparedQuery<ServerPreparedQueryBindings>
Query.CancelStatus
Modifier and Type | Field and Description |
---|---|
static int |
BLOB_STREAM_READ_BUF_SIZE |
protected NativeMessageBuilder |
commandBuilder |
protected RuntimeProperty<java.lang.Boolean> |
explainSlowQueries |
protected boolean |
gatherPerfMetrics
The "gatherPerfMetrics" connection property value
|
protected boolean |
logSlowQueries
The "logSlowQueries" connection property value
|
static byte |
OPEN_CURSOR_FLAG |
protected boolean |
profileSQL
The "profileSQL" connection property value
|
protected boolean |
queryWasSlow |
protected RuntimeProperty<java.lang.Integer> |
slowQueryThresholdMillis |
protected boolean |
useCursorFetch |
autoClosePStmtStreams, batchCommandIndex, originalSql, parameterCount, parseInfo, queryBindings, useStreamLengthsInPrepStmts
batchedArgs, cancelTimeoutMutex, charEncoding, clearWarningsCalled, currentDb, fetchSize, maxAllowedPacket, resultSetType, session, statementExecuting, statementId, timeoutInMillis
Modifier | Constructor and Description |
---|---|
protected |
ServerPreparedQuery(NativeSession sess) |
Modifier and Type | Method and Description |
---|---|
void |
clearParameters(boolean clearServerParameters) |
void |
closeQuery() |
protected long[] |
computeMaxParameterSetSizeAndBatchSize(int numBatchedArgs)
Computes the maximum parameter set size and the size of the entire batch given
the number of arguments in the batch.
|
<M extends Message> |
fillSendPacket()
Creates the packet that contains the query to be sent to the server.
|
<M extends Message> |
fillSendPacket(QueryBindings<?> bindings)
Creates the packet that contains the query to be sent to the server.
|
static ServerPreparedQuery |
getInstance(NativeSession sess) |
Field[] |
getParameterFields() |
ColumnDefinition |
getResultFields() |
long |
getServerStatementId() |
NativePacketPayload |
prepareExecutePacket() |
<T extends Resultset> |
readExecuteResult(NativePacketPayload resultPacket,
int maxRowsToRetrieve,
boolean createStreamingResultSet,
ColumnDefinition metadata,
ProtocolEntityFactory<T,NativePacketPayload> resultSetFactory,
java.lang.String queryAsString) |
NativePacketPayload |
sendExecutePacket(NativePacketPayload packet,
java.lang.String queryAsString) |
<T extends Resultset> |
serverExecute(int maxRowsToRetrieve,
boolean createStreamingResultSet,
ColumnDefinition metadata,
ProtocolEntityFactory<T,NativePacketPayload> resultSetFactory) |
void |
serverPrepare(java.lang.String sql) |
void |
serverResetStatement() |
void |
setParameterFields(Field[] parameterFields) |
void |
setResultFields(ColumnDefinition resultFields) |
void |
setServerStatementId(long serverStatementId) |
void |
statementBegins() |
void |
storeReader(int parameterIndex,
NativePacketPayload packet,
java.io.Reader inStream) |
void |
storeStream(int parameterIndex,
NativePacketPayload packet,
java.io.InputStream inStream) |
asSql, asSql, checkNullOrEmptyQuery, computeBatchSize, getBatchCommandIndex, getOriginalSql, getParameterCount, getParseInfo, getQueryBindings, setBatchCommandIndex, setOriginalSql, setParameterCount, setParseInfo, setQueryBindings
addBatch, checkCancelTimeout, clearBatchedArgs, getBatchedArgs, getCancelTimeoutMutex, getCurrentDatabase, getExecuteTime, getId, getResultFetchSize, getResultSetFactory, getResultType, getSession, getStatementExecuting, getTimeoutInMillis, isClearWarningsCalled, resetCancelledState, setCancelStatus, setClearWarningsCalled, setCurrentDatabase, setExecuteTime, setResultFetchSize, setResultType, setTimeoutInMillis, startQueryTimer, stopQueryTimer
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addBatch, checkCancelTimeout, clearBatchedArgs, getBatchedArgs, getCancelTimeoutMutex, getCurrentDatabase, getExecuteTime, getId, getResultFetchSize, getResultSetFactory, getResultType, getSession, getStatementExecuting, getTimeoutInMillis, isClearWarningsCalled, resetCancelledState, setCancelStatus, setClearWarningsCalled, setCurrentDatabase, setExecuteTime, setResultFetchSize, setResultType, setTimeoutInMillis, startQueryTimer, stopQueryTimer
public static final int BLOB_STREAM_READ_BUF_SIZE
public static final byte OPEN_CURSOR_FLAG
protected boolean profileSQL
protected boolean gatherPerfMetrics
protected boolean logSlowQueries
protected RuntimeProperty<java.lang.Integer> slowQueryThresholdMillis
protected RuntimeProperty<java.lang.Boolean> explainSlowQueries
protected boolean useCursorFetch
protected boolean queryWasSlow
protected NativeMessageBuilder commandBuilder
protected ServerPreparedQuery(NativeSession sess)
public static ServerPreparedQuery getInstance(NativeSession sess)
public void serverPrepare(java.lang.String sql) throws java.io.IOException
sql
- query stringjava.io.IOException
- if an i/o error occurspublic void statementBegins()
statementBegins
in interface Query
statementBegins
in class AbstractQuery
public <T extends Resultset> T serverExecute(int maxRowsToRetrieve, boolean createStreamingResultSet, ColumnDefinition metadata, ProtocolEntityFactory<T,NativePacketPayload> resultSetFactory)
T
- extends Resultset
maxRowsToRetrieve
- rows limitcreateStreamingResultSet
- should c/J create a streaming result?metadata
- use this metadata instead of the one provided on wireresultSetFactory
- ProtocolEntityFactory
public NativePacketPayload prepareExecutePacket()
public NativePacketPayload sendExecutePacket(NativePacketPayload packet, java.lang.String queryAsString)
public <T extends Resultset> T readExecuteResult(NativePacketPayload resultPacket, int maxRowsToRetrieve, boolean createStreamingResultSet, ColumnDefinition metadata, ProtocolEntityFactory<T,NativePacketPayload> resultSetFactory, java.lang.String queryAsString)
public void closeQuery()
closeQuery
in interface Query
closeQuery
in class AbstractPreparedQuery<ServerPreparedQueryBindings>
public long getServerStatementId()
public void setServerStatementId(long serverStatementId)
public Field[] getParameterFields()
public void setParameterFields(Field[] parameterFields)
public ColumnDefinition getResultFields()
public void setResultFields(ColumnDefinition resultFields)
public void storeStream(int parameterIndex, NativePacketPayload packet, java.io.InputStream inStream)
public void storeReader(int parameterIndex, NativePacketPayload packet, java.io.Reader inStream)
public void clearParameters(boolean clearServerParameters)
clearServerParameters
- flag indicating whether we need an additional clean uppublic void serverResetStatement()
protected long[] computeMaxParameterSetSizeAndBatchSize(int numBatchedArgs)
computeMaxParameterSetSizeAndBatchSize
in class AbstractPreparedQuery<ServerPreparedQueryBindings>
public <M extends Message> M fillSendPacket()
AbstractPreparedQuery
fillSendPacket
in interface PreparedQuery<ServerPreparedQueryBindings>
fillSendPacket
in class AbstractPreparedQuery<ServerPreparedQueryBindings>
public <M extends Message> M fillSendPacket(QueryBindings<?> bindings)
AbstractPreparedQuery
fillSendPacket
in interface PreparedQuery<ServerPreparedQueryBindings>
fillSendPacket
in class AbstractPreparedQuery<ServerPreparedQueryBindings>
bindings
- values