类 StatementImpl
- java.lang.Object
-
- com.mysql.cj.jdbc.StatementImpl
-
- 所有已实现的接口:
JdbcStatement,Query,AutoCloseable,Statement,Wrapper
- 直接已知子类:
ClientPreparedStatement
public class StatementImpl extends Object implements JdbcStatement
A Statement object is used for executing a static SQL statement and obtaining the results produced by it. Only one ResultSet per Statement can be open at any point in time. Therefore, if the reading of one ResultSet is interleaved with the reading of another, each must have been generated by different Statements. All statement execute methods implicitly close a statement's current ResultSet if an open one exists.
-
-
嵌套类概要
-
从接口继承的嵌套类/接口 com.mysql.cj.Query
Query.CancelStatus
-
-
字段概要
字段 修饰符和类型 字段 说明 protected ArrayList<Row>batchedGeneratedKeysprotected StringcharEncodingThe character encoding to use (if available)protected NativeMessageBuildercommandBuilderprotected JdbcConnectionconnectionThe connection that created usprotected booleancontinueBatchOnErrorprotected booleandoEscapeProcessingShould we process escape codes?protected booleandontCheckOnDuplicateKeyUpdateInSQLprotected RuntimeProperty<Boolean>dontTrackOpenResourcesprotected RuntimeProperty<Boolean>dumpQueriesOnExceptionprotected ExceptionInterceptorexceptionInterceptorprotected ResultSetInternalMethodsgeneratedKeysResultsprotected booleanholdResultsOpenOverCloseShould this statement hold results open over .close() irregardless of connection's setting?protected booleanisClosedHas this statement been closed?protected longlastInsertIdThe auto_increment value for the last insertprotected booleanlastQueryIsOnDupKeyUpdateWhether or not the last query was of the form ON DUPLICATE KEY UPDATEprotected booleanlogSlowQueriesprotected RuntimeProperty<Integer>maxAllowedPacketprotected intmaxFieldSizeThe max field size for this statementintmaxRowsThe maximum number of rows to return for this statement (-1 means _all_ rows)protected Set<ResultSetInternalMethods>openResultsSet of currently-open ResultSetsprotected booleanpedanticAre we in pedantic mode?protected static StringPING_MARKERprotected PingTargetpingTargetprotected booleanprofileSQLShould we profile?protected Queryqueryprotected ResultSetInternalMethodsresultsThe current resultsprotected intresultSetConcurrencyThe concurrency for this result set (updatable or not)protected ResultSetFactoryresultSetFactoryprotected booleanretrieveGeneratedKeysprotected RuntimeProperty<Boolean>rewriteBatchedStatementsprotected NativeSessionsessionprotected longupdateCountThe update count for this statementstatic byteUSES_VARIABLES_FALSEstatic byteUSES_VARIABLES_TRUEstatic byteUSES_VARIABLES_UNKNOWNprotected booleanuseUsageAdvisorShould we use the usage advisor?protected SQLWarningwarningChainThe warnings chain.-
从接口继承的字段 com.mysql.cj.jdbc.JdbcStatement
MAX_ROWS
-
-
构造器概要
构造器 构造器 说明 StatementImpl(JdbcConnection c, String db)Constructor for a Statement.
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidaddBatch(Object batch)voidaddBatch(String sql)voidcancel()voidcheckCancelTimeout()protected JdbcConnectioncheckClosed()Checks if closed() has been called, and throws an exception if soprotected voidcheckNullOrEmptyQuery(String sql)Method checkNullOrEmptyQuery.voidclearAttributes()voidclearBatch()voidclearBatchedArgs()voidclearWarnings()voidclose()In many cases, it is desirable to immediately release a Statement's database and JDBC resources instead of waiting for this to happen when it is automatically closed.protected voidcloseAllOpenResults()Close any open result sets that have been 'held open'voidcloseOnCompletion()voidcloseQuery()protected booleancontainsOnDuplicateKeyInString(String sql)protected booleancreateStreamingResultSet()We only stream result sets when they are forward-only, read-only, and the fetch size has been set to Integer.MIN_VALUEvoiddisableStreamingResults()Resets this statements fetch size and result set type to the values they had before enableStreamingResults() was called.protected voiddoPingInstead()voidenableStreamingResults()Workaround for containers that 'check' for sane values of Statement.setFetchSize() so that applications can use the Java variant of libmysql's mysql_use_result() behavior.booleanexecute(String sql)booleanexecute(String sql, int returnGeneratedKeys)booleanexecute(String sql, int[] generatedKeyIndices)booleanexecute(String sql, String[] generatedKeyNames)int[]executeBatch()protected long[]executeBatchInternal()long[]executeLargeBatch()longexecuteLargeUpdate(String sql)longexecuteLargeUpdate(String sql, int autoGeneratedKeys)longexecuteLargeUpdate(String sql, int[] columnIndexes)longexecuteLargeUpdate(String sql, String[] columnNames)ResultSetexecuteQuery(String sql)voidexecuteSimpleNonQuery(JdbcConnection c, String nonQuery)intexecuteUpdate(String sql)intexecuteUpdate(String sql, int autoGeneratedKeys)intexecuteUpdate(String sql, int[] columnIndexes)intexecuteUpdate(String sql, String[] columnNames)protected longexecuteUpdateInternal(String sql, boolean isBatch, boolean returnGeneratedKeys)protected ResultSetInternalMethodsgeneratePingResultSet()List<Object>getBatchedArgs()Get the batched args as added by the addBatch method(s).protected voidgetBatchedGeneratedKeys(int maxKeys)protected voidgetBatchedGeneratedKeys(Statement batchedStatement)ObjectgetCancelTimeoutMutex()ConnectiongetConnection()StringgetCurrentDatabase()ExceptionInterceptorgetExceptionInterceptor()longgetExecuteTime()Returns the elapsed time for the server to execute the query.intgetFetchDirection()intgetFetchSize()ResultSetgetGeneratedKeys()protected ResultSetInternalMethodsgetGeneratedKeysInternal()protected ResultSetInternalMethodsgetGeneratedKeysInternal(long numKeys)intgetId()Returns the query id used when profilinglonggetLargeMaxRows()longgetLargeUpdateCount()longgetLastInsertID()getLastInsertID returns the value of the auto_incremented key after an executeQuery() or excute() call.InputStreamgetLocalInfileInputStream()Returns the InputStream instance that will be used to send data in response to a "LOAD DATA LOCAL INFILE" statement.longgetLongUpdateCount()getLongUpdateCount returns the current result as an update count, if the result is a ResultSet or there are no more results, -1 is returned.intgetMaxFieldSize()intgetMaxRows()booleangetMoreResults()booleangetMoreResults(int current)intgetOpenResultSetCount()Returns the number of open result sets for this statement.QuerygetQuery()QueryAttributesBindingsgetQueryAttributesBindings()intgetQueryTimeout()intgetResultFetchSize()ResultSetgetResultSet()intgetResultSetConcurrency()<T extends Resultset,M extends Message>
ProtocolEntityFactory<T,M>getResultSetFactory()intgetResultSetHoldability()ResultSetInternalMethodsgetResultSetInternal()intgetResultSetType()Resultset.TypegetResultType()longgetServerStatementId()SessiongetSession()AtomicBooleangetStatementExecuting()intgetTimeoutInMillis()intgetUpdateCount()SQLWarninggetWarnings()protected SQLExceptionhandleExceptionForBatch(int endOfBatchIndex, int numValuesPerBatch, long[] updateCounts, SQLException ex)protected booleanhasDeadlockOrTimeoutRolledBackTx(SQLException ex)protected voidimplicitlyCloseAllOpenResults()Close all result sets in this statement.protected voidinitQuery()booleanisClearWarningsCalled()booleanisClosed()booleanisCloseOnCompletion()protected booleanisNonResultSetProducingQuery(String sql)Checks if the given SQL query does not return a result set.booleanisPoolable()protected booleanisResultSetProducingQuery(String sql)Checks if the given SQL query is a result set producing query.booleanisWrapperFor(Class<?> iface)protected intprocessMultiCountsAndKeys(StatementImpl batchedStatement, int updateCountCounter, long[] updateCounts)protected voidrealClose(boolean calledExplicitly, boolean closeOpenResults)Closes this statement, and frees resources.voidremoveOpenResultSet(ResultSetInternalMethods rs)Callback for result set instances to remove them from the Set that tracks them per-statementvoidresetCancelledState()voidsetAttribute(String name, Object value)voidsetCancelStatus(Query.CancelStatus cs)voidsetClearWarningsCalled(boolean clearWarningsCalled)voidsetCurrentDatabase(String currentDb)voidsetCursorName(String name)voidsetEscapeProcessing(boolean enable)voidsetExecuteTime(long executeTime)voidsetFetchDirection(int direction)voidsetFetchSize(int rows)voidsetHoldResultsOpenOverClose(boolean holdResultsOpenOverClose)voidsetLargeMaxRows(long max)voidsetLocalInfileInputStream(InputStream stream)Sets an InputStream instance that will be used to send data to the MySQL server for a "LOAD DATA LOCAL INFILE" statement rather than a FileInputStream or URLInputStream that represents the path given as an argument to the statement.voidsetMaxFieldSize(int max)voidsetMaxRows(int max)voidsetPingTarget(PingTarget pingTarget)voidsetPoolable(boolean poolable)voidsetQueryTimeout(int seconds)voidsetResultFetchSize(int fetchSize)voidsetResultType(Resultset.Type resultSetType)voidsetTimeoutInMillis(int timeoutInMillis)protected voidsetupStreamingTimeout(JdbcConnection con)Adjust net_write_timeout to a higher value if we're streaming result sets.CancelQueryTaskstartQueryTimer(Query stmtToCancel, int timeout)voidstatementBegins()voidstopQueryTimer(CancelQueryTask timeoutTask, boolean rethrowCancelReason, boolean checkCancelTimeout)<T> Tunwrap(Class<T> iface)-
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
从接口继承的方法 java.sql.Statement
enquoteIdentifier, enquoteLiteral, enquoteNCharLiteral, isSimpleIdentifier
-
-
-
-
字段详细资料
-
USES_VARIABLES_FALSE
public static final byte USES_VARIABLES_FALSE
- 另请参阅:
- 常量字段值
-
USES_VARIABLES_TRUE
public static final byte USES_VARIABLES_TRUE
- 另请参阅:
- 常量字段值
-
USES_VARIABLES_UNKNOWN
public static final byte USES_VARIABLES_UNKNOWN
- 另请参阅:
- 常量字段值
-
commandBuilder
protected NativeMessageBuilder commandBuilder
-
charEncoding
protected String charEncoding
The character encoding to use (if available)
-
connection
protected volatile JdbcConnection connection
The connection that created us
-
doEscapeProcessing
protected boolean doEscapeProcessing
Should we process escape codes?
-
isClosed
protected boolean isClosed
Has this statement been closed?
-
lastInsertId
protected long lastInsertId
The auto_increment value for the last insert
-
maxFieldSize
protected int maxFieldSize
The max field size for this statement
-
maxRows
public int maxRows
The maximum number of rows to return for this statement (-1 means _all_ rows)
-
openResults
protected Set<ResultSetInternalMethods> openResults
Set of currently-open ResultSets
-
pedantic
protected boolean pedantic
Are we in pedantic mode?
-
profileSQL
protected boolean profileSQL
Should we profile?
-
results
protected ResultSetInternalMethods results
The current results
-
generatedKeysResults
protected ResultSetInternalMethods generatedKeysResults
-
resultSetConcurrency
protected int resultSetConcurrency
The concurrency for this result set (updatable or not)
-
updateCount
protected long updateCount
The update count for this statement
-
useUsageAdvisor
protected boolean useUsageAdvisor
Should we use the usage advisor?
-
warningChain
protected SQLWarning warningChain
The warnings chain.
-
holdResultsOpenOverClose
protected boolean holdResultsOpenOverClose
Should this statement hold results open over .close() irregardless of connection's setting?
-
retrieveGeneratedKeys
protected boolean retrieveGeneratedKeys
-
continueBatchOnError
protected boolean continueBatchOnError
-
pingTarget
protected PingTarget pingTarget
-
exceptionInterceptor
protected ExceptionInterceptor exceptionInterceptor
-
lastQueryIsOnDupKeyUpdate
protected boolean lastQueryIsOnDupKeyUpdate
Whether or not the last query was of the form ON DUPLICATE KEY UPDATE
-
dontTrackOpenResources
protected RuntimeProperty<Boolean> dontTrackOpenResources
-
dumpQueriesOnException
protected RuntimeProperty<Boolean> dumpQueriesOnException
-
logSlowQueries
protected boolean logSlowQueries
-
rewriteBatchedStatements
protected RuntimeProperty<Boolean> rewriteBatchedStatements
-
maxAllowedPacket
protected RuntimeProperty<Integer> maxAllowedPacket
-
dontCheckOnDuplicateKeyUpdateInSQL
protected boolean dontCheckOnDuplicateKeyUpdateInSQL
-
resultSetFactory
protected ResultSetFactory resultSetFactory
-
query
protected Query query
-
session
protected NativeSession session
-
-
构造器详细资料
-
StatementImpl
public StatementImpl(JdbcConnection c, String db) throws SQLException
Constructor for a Statement.- 参数:
c- the Connection instance that creates usdb- the database name in use when we were created- 抛出:
SQLException- if an error occurs.
-
-
方法详细资料
-
initQuery
protected void initQuery()
-
addBatch
public void addBatch(String sql) throws SQLException
- 指定者:
addBatch在接口中Statement- 抛出:
SQLException
-
getBatchedArgs
public List<Object> getBatchedArgs()
从接口复制的说明:QueryGet the batched args as added by the addBatch method(s). The list is unmodifiable and might contain any combination of String, ClientPreparedQueryBindings, or ServerPreparedQueryBindings depending on how the parameters were batched.- 指定者:
getBatchedArgs在接口中Query- 返回:
- an unmodifiable List of batched args
-
cancel
public void cancel() throws SQLException- 指定者:
cancel在接口中Statement- 抛出:
SQLException
-
checkClosed
protected JdbcConnection checkClosed()
Checks if closed() has been called, and throws an exception if so- 返回:
- connection
- 抛出:
StatementIsClosedException- if this statement has been closed
-
isResultSetProducingQuery
protected boolean isResultSetProducingQuery(String sql)
Checks if the given SQL query is a result set producing query.- 参数:
sql- the SQL to check- 返回:
trueif the query produces a result set,falseotherwise.
-
isNonResultSetProducingQuery
protected boolean isNonResultSetProducingQuery(String sql)
Checks if the given SQL query does not return a result set.- 参数:
sql- the SQL to check- 返回:
trueif the query does not produce a result set,falseotherwise.
-
checkNullOrEmptyQuery
protected void checkNullOrEmptyQuery(String sql) throws SQLException
Method checkNullOrEmptyQuery.- 参数:
sql- the SQL to check- 抛出:
SQLException- if query is null or empty.
-
clearBatch
public void clearBatch() throws SQLException- 指定者:
clearBatch在接口中Statement- 抛出:
SQLException
-
clearBatchedArgs
public void clearBatchedArgs()
- 指定者:
clearBatchedArgs在接口中Query
-
clearWarnings
public void clearWarnings() throws SQLException- 指定者:
clearWarnings在接口中Statement- 抛出:
SQLException
-
close
public void close() throws SQLExceptionIn many cases, it is desirable to immediately release a Statement's database and JDBC resources instead of waiting for this to happen when it is automatically closed. The close method provides this immediate release.Note: A Statement is automatically closed when it is garbage collected. When a Statement is closed, its current ResultSet, if one exists, is also closed.
- 指定者:
close在接口中AutoCloseable- 指定者:
close在接口中Statement- 抛出:
SQLException- if a database access error occurs
-
closeAllOpenResults
protected void closeAllOpenResults() throws SQLExceptionClose any open result sets that have been 'held open'- 抛出:
SQLException- if an error occurs
-
implicitlyCloseAllOpenResults
protected void implicitlyCloseAllOpenResults() throws SQLExceptionClose all result sets in this statement. This includes multi-results- 抛出:
SQLException- if a database access error occurs
-
removeOpenResultSet
public void removeOpenResultSet(ResultSetInternalMethods rs)
从接口复制的说明:JdbcStatementCallback for result set instances to remove them from the Set that tracks them per-statement- 指定者:
removeOpenResultSet在接口中JdbcStatement- 参数:
rs- result set
-
getOpenResultSetCount
public int getOpenResultSetCount()
从接口复制的说明:JdbcStatementReturns the number of open result sets for this statement.- 指定者:
getOpenResultSetCount在接口中JdbcStatement- 返回:
- the number of open result sets for this statement
-
createStreamingResultSet
protected boolean createStreamingResultSet()
We only stream result sets when they are forward-only, read-only, and the fetch size has been set to Integer.MIN_VALUE- 返回:
- true if this result set should be streamed row at-a-time, rather than read all at once.
-
enableStreamingResults
public void enableStreamingResults() throws SQLException从接口复制的说明:JdbcStatementWorkaround for containers that 'check' for sane values of Statement.setFetchSize() so that applications can use the Java variant of libmysql's mysql_use_result() behavior.- 指定者:
enableStreamingResults在接口中JdbcStatement- 抛出:
SQLException- if an error occurs
-
disableStreamingResults
public void disableStreamingResults() throws SQLException从接口复制的说明:JdbcStatementResets this statements fetch size and result set type to the values they had before enableStreamingResults() was called.- 指定者:
disableStreamingResults在接口中JdbcStatement- 抛出:
SQLException- if an error occurs
-
setupStreamingTimeout
protected void setupStreamingTimeout(JdbcConnection con) throws SQLException
Adjust net_write_timeout to a higher value if we're streaming result sets. More often than not, someone runs into an issue where they blow net_write_timeout when using this feature, and if they're willing to hold a result set open for 30 seconds or more, one more round-trip isn't going to hurt. This is reset by RowDataDynamic.close().- 参数:
con- created this statement- 抛出:
SQLException- if a database error occurs
-
startQueryTimer
public CancelQueryTask startQueryTimer(Query stmtToCancel, int timeout)
- 指定者:
startQueryTimer在接口中Query
-
stopQueryTimer
public void stopQueryTimer(CancelQueryTask timeoutTask, boolean rethrowCancelReason, boolean checkCancelTimeout)
- 指定者:
stopQueryTimer在接口中Query
-
execute
public boolean execute(String sql) throws SQLException
- 指定者:
execute在接口中Statement- 抛出:
SQLException
-
statementBegins
public void statementBegins()
- 指定者:
statementBegins在接口中Query
-
resetCancelledState
public void resetCancelledState()
- 指定者:
resetCancelledState在接口中Query
-
execute
public boolean execute(String sql, int returnGeneratedKeys) throws SQLException
- 指定者:
execute在接口中Statement- 抛出:
SQLException
-
execute
public boolean execute(String sql, int[] generatedKeyIndices) throws SQLException
- 指定者:
execute在接口中Statement- 抛出:
SQLException
-
execute
public boolean execute(String sql, String[] generatedKeyNames) throws SQLException
- 指定者:
execute在接口中Statement- 抛出:
SQLException
-
executeBatch
public int[] executeBatch() throws SQLException- 指定者:
executeBatch在接口中Statement- 抛出:
SQLException
-
executeBatchInternal
protected long[] executeBatchInternal() throws SQLException- 抛出:
SQLException
-
hasDeadlockOrTimeoutRolledBackTx
protected final boolean hasDeadlockOrTimeoutRolledBackTx(SQLException ex)
-
processMultiCountsAndKeys
protected int processMultiCountsAndKeys(StatementImpl batchedStatement, int updateCountCounter, long[] updateCounts) throws SQLException
- 抛出:
SQLException
-
handleExceptionForBatch
protected SQLException handleExceptionForBatch(int endOfBatchIndex, int numValuesPerBatch, long[] updateCounts, SQLException ex) throws BatchUpdateException, SQLException
-
executeQuery
public ResultSet executeQuery(String sql) throws SQLException
- 指定者:
executeQuery在接口中Statement- 抛出:
SQLException
-
doPingInstead
protected void doPingInstead() throws SQLException- 抛出:
SQLException
-
generatePingResultSet
protected ResultSetInternalMethods generatePingResultSet() throws SQLException
- 抛出:
SQLException
-
executeSimpleNonQuery
public void executeSimpleNonQuery(JdbcConnection c, String nonQuery) throws SQLException
- 抛出:
SQLException
-
executeUpdate
public int executeUpdate(String sql) throws SQLException
- 指定者:
executeUpdate在接口中Statement- 抛出:
SQLException
-
executeUpdateInternal
protected long executeUpdateInternal(String sql, boolean isBatch, boolean returnGeneratedKeys) throws SQLException
- 抛出:
SQLException
-
executeUpdate
public int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException
- 指定者:
executeUpdate在接口中Statement- 抛出:
SQLException
-
executeUpdate
public int executeUpdate(String sql, int[] columnIndexes) throws SQLException
- 指定者:
executeUpdate在接口中Statement- 抛出:
SQLException
-
executeUpdate
public int executeUpdate(String sql, String[] columnNames) throws SQLException
- 指定者:
executeUpdate在接口中Statement- 抛出:
SQLException
-
getConnection
public Connection getConnection() throws SQLException
- 指定者:
getConnection在接口中Statement- 抛出:
SQLException
-
getFetchDirection
public int getFetchDirection() throws SQLException- 指定者:
getFetchDirection在接口中Statement- 抛出:
SQLException
-
getFetchSize
public int getFetchSize() throws SQLException- 指定者:
getFetchSize在接口中Statement- 抛出:
SQLException
-
getGeneratedKeys
public ResultSet getGeneratedKeys() throws SQLException
- 指定者:
getGeneratedKeys在接口中Statement- 抛出:
SQLException
-
getGeneratedKeysInternal
protected ResultSetInternalMethods getGeneratedKeysInternal() throws SQLException
- 抛出:
SQLException
-
getGeneratedKeysInternal
protected ResultSetInternalMethods getGeneratedKeysInternal(long numKeys) throws SQLException
- 抛出:
SQLException
-
getLastInsertID
public long getLastInsertID()
getLastInsertID returns the value of the auto_incremented key after an executeQuery() or excute() call.This gets around the un-threadsafe behavior of "select LAST_INSERT_ID()" which is tied to the Connection that created this Statement, and therefore could have had many INSERTS performed before one gets a chance to call "select LAST_INSERT_ID()".
- 返回:
- the last update ID.
-
getLongUpdateCount
public long getLongUpdateCount()
getLongUpdateCount returns the current result as an update count, if the result is a ResultSet or there are no more results, -1 is returned. It should only be called once per result.This method returns longs as MySQL server returns 64-bit values for update counts
- 返回:
- the current update count.
-
getMaxFieldSize
public int getMaxFieldSize() throws SQLException- 指定者:
getMaxFieldSize在接口中Statement- 抛出:
SQLException
-
getMaxRows
public int getMaxRows() throws SQLException- 指定者:
getMaxRows在接口中Statement- 抛出:
SQLException
-
getMoreResults
public boolean getMoreResults() throws SQLException- 指定者:
getMoreResults在接口中Statement- 抛出:
SQLException
-
getMoreResults
public boolean getMoreResults(int current) throws SQLException- 指定者:
getMoreResults在接口中Statement- 抛出:
SQLException
-
getQueryTimeout
public int getQueryTimeout() throws SQLException- 指定者:
getQueryTimeout在接口中Statement- 抛出:
SQLException
-
getResultSet
public ResultSet getResultSet() throws SQLException
- 指定者:
getResultSet在接口中Statement- 抛出:
SQLException
-
getResultSetConcurrency
public int getResultSetConcurrency() throws SQLException- 指定者:
getResultSetConcurrency在接口中Statement- 抛出:
SQLException
-
getResultSetHoldability
public int getResultSetHoldability() throws SQLException- 指定者:
getResultSetHoldability在接口中Statement- 抛出:
SQLException
-
getResultSetInternal
public ResultSetInternalMethods getResultSetInternal()
- 指定者:
getResultSetInternal在接口中JdbcStatement
-
getResultSetType
public int getResultSetType() throws SQLException- 指定者:
getResultSetType在接口中Statement- 抛出:
SQLException
-
getUpdateCount
public int getUpdateCount() throws SQLException- 指定者:
getUpdateCount在接口中Statement- 抛出:
SQLException
-
getWarnings
public SQLWarning getWarnings() throws SQLException
- 指定者:
getWarnings在接口中Statement- 抛出:
SQLException
-
realClose
protected void realClose(boolean calledExplicitly, boolean closeOpenResults) throws SQLExceptionCloses this statement, and frees resources.- 参数:
calledExplicitly- was this called from close()?closeOpenResults- should open result sets be closed?- 抛出:
SQLException- if an error occurs
-
setCursorName
public void setCursorName(String name) throws SQLException
- 指定者:
setCursorName在接口中Statement- 抛出:
SQLException
-
setEscapeProcessing
public void setEscapeProcessing(boolean enable) throws SQLException- 指定者:
setEscapeProcessing在接口中Statement- 抛出:
SQLException
-
setFetchDirection
public void setFetchDirection(int direction) throws SQLException- 指定者:
setFetchDirection在接口中Statement- 抛出:
SQLException
-
setFetchSize
public void setFetchSize(int rows) throws SQLException- 指定者:
setFetchSize在接口中Statement- 抛出:
SQLException
-
setHoldResultsOpenOverClose
public void setHoldResultsOpenOverClose(boolean holdResultsOpenOverClose)
- 指定者:
setHoldResultsOpenOverClose在接口中JdbcStatement
-
setMaxFieldSize
public void setMaxFieldSize(int max) throws SQLException- 指定者:
setMaxFieldSize在接口中Statement- 抛出:
SQLException
-
setMaxRows
public void setMaxRows(int max) throws SQLException- 指定者:
setMaxRows在接口中Statement- 抛出:
SQLException
-
setQueryTimeout
public void setQueryTimeout(int seconds) throws SQLException- 指定者:
setQueryTimeout在接口中Statement- 抛出:
SQLException
-
getBatchedGeneratedKeys
protected void getBatchedGeneratedKeys(Statement batchedStatement) throws SQLException
- 抛出:
SQLException
-
getBatchedGeneratedKeys
protected void getBatchedGeneratedKeys(int maxKeys) throws SQLException- 抛出:
SQLException
-
isClosed
public boolean isClosed() throws SQLException- 指定者:
isClosed在接口中Statement- 抛出:
SQLException
-
isPoolable
public boolean isPoolable() throws SQLException- 指定者:
isPoolable在接口中Statement- 抛出:
SQLException
-
setPoolable
public void setPoolable(boolean poolable) throws SQLException- 指定者:
setPoolable在接口中Statement- 抛出:
SQLException
-
isWrapperFor
public boolean isWrapperFor(Class<?> iface) throws SQLException
- 指定者:
isWrapperFor在接口中Wrapper- 抛出:
SQLException
-
unwrap
public <T> T unwrap(Class<T> iface) throws SQLException
- 指定者:
unwrap在接口中Wrapper- 抛出:
SQLException
-
getLocalInfileInputStream
public InputStream getLocalInfileInputStream()
从接口复制的说明:JdbcStatementReturns the InputStream instance that will be used to send data in response to a "LOAD DATA LOCAL INFILE" statement. This method returns NULL if no such stream has been set via setLocalInfileInputStream().- 指定者:
getLocalInfileInputStream在接口中JdbcStatement- 返回:
- input stream
-
setLocalInfileInputStream
public void setLocalInfileInputStream(InputStream stream)
从接口复制的说明:JdbcStatementSets an InputStream instance that will be used to send data to the MySQL server for a "LOAD DATA LOCAL INFILE" statement rather than a FileInputStream or URLInputStream that represents the path given as an argument to the statement. This stream will be read to completion upon execution of a "LOAD DATA LOCAL INFILE" statement, and will automatically be closed by the driver, so it needs to be reset before each call to execute*() that would cause the MySQL server to request data to fulfill the request for "LOAD DATA LOCAL INFILE". If this value is set to NULL, the driver will revert to using a FileInputStream or URLInputStream as required.- 指定者:
setLocalInfileInputStream在接口中JdbcStatement- 参数:
stream- input stream
-
setPingTarget
public void setPingTarget(PingTarget pingTarget)
- 指定者:
setPingTarget在接口中JdbcStatement
-
getExceptionInterceptor
public ExceptionInterceptor getExceptionInterceptor()
- 指定者:
getExceptionInterceptor在接口中JdbcStatement
-
containsOnDuplicateKeyInString
protected boolean containsOnDuplicateKeyInString(String sql)
-
closeOnCompletion
public void closeOnCompletion() throws SQLException- 指定者:
closeOnCompletion在接口中Statement- 抛出:
SQLException
-
isCloseOnCompletion
public boolean isCloseOnCompletion() throws SQLException- 指定者:
isCloseOnCompletion在接口中Statement- 抛出:
SQLException
-
executeLargeBatch
public long[] executeLargeBatch() throws SQLException- 指定者:
executeLargeBatch在接口中Statement- 抛出:
SQLException
-
executeLargeUpdate
public long executeLargeUpdate(String sql) throws SQLException
- 指定者:
executeLargeUpdate在接口中Statement- 抛出:
SQLException
-
executeLargeUpdate
public long executeLargeUpdate(String sql, int autoGeneratedKeys) throws SQLException
- 指定者:
executeLargeUpdate在接口中Statement- 抛出:
SQLException
-
executeLargeUpdate
public long executeLargeUpdate(String sql, int[] columnIndexes) throws SQLException
- 指定者:
executeLargeUpdate在接口中Statement- 抛出:
SQLException
-
executeLargeUpdate
public long executeLargeUpdate(String sql, String[] columnNames) throws SQLException
- 指定者:
executeLargeUpdate在接口中Statement- 抛出:
SQLException
-
getLargeMaxRows
public long getLargeMaxRows() throws SQLException- 指定者:
getLargeMaxRows在接口中Statement- 抛出:
SQLException
-
getLargeUpdateCount
public long getLargeUpdateCount() throws SQLException- 指定者:
getLargeUpdateCount在接口中Statement- 抛出:
SQLException
-
setLargeMaxRows
public void setLargeMaxRows(long max) throws SQLException- 指定者:
setLargeMaxRows在接口中Statement- 抛出:
SQLException
-
getCurrentDatabase
public String getCurrentDatabase()
- 指定者:
getCurrentDatabase在接口中Query
-
getServerStatementId
public long getServerStatementId()
-
getResultSetFactory
public <T extends Resultset,M extends Message> ProtocolEntityFactory<T,M> getResultSetFactory()
- 指定者:
getResultSetFactory在接口中Query
-
getId
public int getId()
从接口复制的说明:QueryReturns the query id used when profiling
-
setCancelStatus
public void setCancelStatus(Query.CancelStatus cs)
- 指定者:
setCancelStatus在接口中Query
-
checkCancelTimeout
public void checkCancelTimeout()
- 指定者:
checkCancelTimeout在接口中Query
-
getSession
public Session getSession()
- 指定者:
getSession在接口中Query
-
getCancelTimeoutMutex
public Object getCancelTimeoutMutex()
- 指定者:
getCancelTimeoutMutex在接口中Query
-
closeQuery
public void closeQuery()
- 指定者:
closeQuery在接口中Query
-
getResultFetchSize
public int getResultFetchSize()
- 指定者:
getResultFetchSize在接口中Query
-
setResultFetchSize
public void setResultFetchSize(int fetchSize)
- 指定者:
setResultFetchSize在接口中Query
-
getResultType
public Resultset.Type getResultType()
- 指定者:
getResultType在接口中Query
-
setResultType
public void setResultType(Resultset.Type resultSetType)
- 指定者:
setResultType在接口中Query
-
getTimeoutInMillis
public int getTimeoutInMillis()
- 指定者:
getTimeoutInMillis在接口中Query
-
setTimeoutInMillis
public void setTimeoutInMillis(int timeoutInMillis)
- 指定者:
setTimeoutInMillis在接口中Query
-
getExecuteTime
public long getExecuteTime()
从接口复制的说明:QueryReturns the elapsed time for the server to execute the query.- 指定者:
getExecuteTime在接口中Query- 返回:
- the time it took for the server to execute the query.
-
setExecuteTime
public void setExecuteTime(long executeTime)
- 指定者:
setExecuteTime在接口中Query
-
getStatementExecuting
public AtomicBoolean getStatementExecuting()
- 指定者:
getStatementExecuting在接口中Query
-
setCurrentDatabase
public void setCurrentDatabase(String currentDb)
- 指定者:
setCurrentDatabase在接口中Query
-
isClearWarningsCalled
public boolean isClearWarningsCalled()
- 指定者:
isClearWarningsCalled在接口中Query
-
setClearWarningsCalled
public void setClearWarningsCalled(boolean clearWarningsCalled)
- 指定者:
setClearWarningsCalled在接口中Query
-
getQuery
public Query getQuery()
- 指定者:
getQuery在接口中JdbcStatement
-
getQueryAttributesBindings
public QueryAttributesBindings getQueryAttributesBindings()
- 指定者:
getQueryAttributesBindings在接口中Query
-
setAttribute
public void setAttribute(String name, Object value)
- 指定者:
setAttribute在接口中JdbcStatement
-
clearAttributes
public void clearAttributes()
- 指定者:
clearAttributes在接口中JdbcStatement
-
-