程序包 com.mysql.cj
类 ServerPreparedQuery
- java.lang.Object
-
- com.mysql.cj.AbstractQuery
-
- com.mysql.cj.ClientPreparedQuery
-
- com.mysql.cj.ServerPreparedQuery
-
- 所有已实现的接口:
PreparedQuery,Query
public class ServerPreparedQuery extends ClientPreparedQuery
-
-
嵌套类概要
-
从接口继承的嵌套类/接口 com.mysql.cj.Query
Query.CancelStatus
-
-
字段概要
字段 修饰符和类型 字段 说明 static intBLOB_STREAM_READ_BUF_SIZEprotected NativeMessageBuildercommandBuilderprotected RuntimeProperty<Boolean>explainSlowQueriesprotected booleangatherPerfMetricsThe "gatherPerfMetrics" connection property valueprotected booleanlogSlowQueriesThe "logSlowQueries" connection property valuestatic byteOPEN_CURSOR_FLAGstatic bytePARAMETER_COUNT_AVAILABLEprotected booleanprofileSQLThe "profileSQL" connection property valueprotected booleanqueryWasSlowprotected RuntimeProperty<Integer>slowQueryThresholdMillisprotected booleanuseCursorFetch-
从类继承的字段 com.mysql.cj.ClientPreparedQuery
autoClosePStmtStreams, batchCommandIndex, originalSql, parameterCount, queryBindings, queryInfo, useStreamLengthsInPrepStmts
-
-
构造器概要
构造器 限定符 构造器 说明 protectedServerPreparedQuery(NativeSession sess)
-
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 voidclearParameters(boolean clearServerParameters)voidcloseQuery()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>
MfillSendPacket(QueryBindings bindings)static ServerPreparedQuerygetInstance(NativeSession sess)Field[]getParameterFields()ColumnDefinitiongetResultFields()longgetServerStatementId()NativePacketPayloadprepareExecutePacket()<T extends Resultset>
TreadExecuteResult(NativePacketPayload resultPacket, int maxRowsToRetrieve, boolean createStreamingResultSet, ColumnDefinition metadata, ProtocolEntityFactory<T,NativePacketPayload> resultSetFactory, String queryAsString)NativePacketPayloadsendExecutePacket(NativePacketPayload packet, String queryAsString)<T extends Resultset>
TserverExecute(int maxRowsToRetrieve, boolean createStreamingResultSet, ColumnDefinition metadata, ProtocolEntityFactory<T,NativePacketPayload> resultSetFactory)voidserverPrepare(String sql)voidserverResetStatement()voidsetParameterFields(Field[] parameterFields)voidsetResultFields(ColumnDefinition resultFields)voidsetServerStatementId(long serverStatementId)voidstatementBegins()-
从类继承的方法 com.mysql.cj.ClientPreparedQuery
asSql, checkNullOrEmptyQuery, computeBatchSize, getBatchCommandIndex, getOriginalSql, getParameterCount, getQueryBindings, getQueryInfo, setBatchCommandIndex, setOriginalSql, setParameterCount, setQueryBindings, setQueryInfo
-
从类继承的方法 com.mysql.cj.AbstractQuery
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, stopQueryTimer
-
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
从接口继承的方法 com.mysql.cj.Query
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, stopQueryTimer
-
-
-
-
字段详细资料
-
BLOB_STREAM_READ_BUF_SIZE
public static final int BLOB_STREAM_READ_BUF_SIZE
- 另请参阅:
- 常量字段值
-
OPEN_CURSOR_FLAG
public static final byte OPEN_CURSOR_FLAG
- 另请参阅:
- 常量字段值
-
PARAMETER_COUNT_AVAILABLE
public static final byte PARAMETER_COUNT_AVAILABLE
- 另请参阅:
- 常量字段值
-
profileSQL
protected boolean profileSQL
The "profileSQL" connection property value
-
gatherPerfMetrics
protected boolean gatherPerfMetrics
The "gatherPerfMetrics" connection property value
-
logSlowQueries
protected boolean logSlowQueries
The "logSlowQueries" connection property value
-
slowQueryThresholdMillis
protected RuntimeProperty<Integer> slowQueryThresholdMillis
-
explainSlowQueries
protected RuntimeProperty<Boolean> explainSlowQueries
-
useCursorFetch
protected boolean useCursorFetch
-
queryWasSlow
protected boolean queryWasSlow
-
commandBuilder
protected NativeMessageBuilder commandBuilder
-
-
构造器详细资料
-
ServerPreparedQuery
protected ServerPreparedQuery(NativeSession sess)
-
-
方法详细资料
-
getInstance
public static ServerPreparedQuery getInstance(NativeSession sess)
-
serverPrepare
public void serverPrepare(String sql) throws IOException
- 参数:
sql- query string- 抛出:
IOException- if an i/o error occurs
-
statementBegins
public void statementBegins()
- 指定者:
statementBegins在接口中Query- 覆盖:
statementBegins在类中AbstractQuery
-
serverExecute
public <T extends Resultset> T serverExecute(int maxRowsToRetrieve, boolean createStreamingResultSet, ColumnDefinition metadata, ProtocolEntityFactory<T,NativePacketPayload> resultSetFactory)
- 类型参数:
T- extendsResultset- 参数:
maxRowsToRetrieve- rows limitcreateStreamingResultSet- should c/J create a streaming result?metadata- use this metadata instead of the one provided on wireresultSetFactory-ProtocolEntityFactory- 返回:
- T instance
-
prepareExecutePacket
public NativePacketPayload prepareExecutePacket()
-
sendExecutePacket
public NativePacketPayload sendExecutePacket(NativePacketPayload packet, String queryAsString)
-
readExecuteResult
public <T extends Resultset> T readExecuteResult(NativePacketPayload resultPacket, int maxRowsToRetrieve, boolean createStreamingResultSet, ColumnDefinition metadata, ProtocolEntityFactory<T,NativePacketPayload> resultSetFactory, String queryAsString)
-
closeQuery
public void closeQuery()
- 指定者:
closeQuery在接口中Query- 覆盖:
closeQuery在类中ClientPreparedQuery
-
getServerStatementId
public long getServerStatementId()
-
setServerStatementId
public void setServerStatementId(long serverStatementId)
-
getParameterFields
public Field[] getParameterFields()
-
setParameterFields
public void setParameterFields(Field[] parameterFields)
-
getResultFields
public ColumnDefinition getResultFields()
-
setResultFields
public void setResultFields(ColumnDefinition resultFields)
-
clearParameters
public void clearParameters(boolean clearServerParameters)
- 参数:
clearServerParameters- flag indicating whether we need an additional clean up
-
serverResetStatement
public void serverResetStatement()
-
computeMaxParameterSetSizeAndBatchSize
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.- 覆盖:
computeMaxParameterSetSizeAndBatchSize在类中ClientPreparedQuery- 参数:
numBatchedArgs- number of batched arguments- 返回:
- new long[] { maxSizeOfParameterSet, sizeOfEntireBatch }
-
fillSendPacket
public <M extends Message> M fillSendPacket(QueryBindings bindings)
- 指定者:
fillSendPacket在接口中PreparedQuery- 覆盖:
fillSendPacket在类中ClientPreparedQuery
-
-