类 ConnectionWrapper
- java.lang.Object
-
- com.mysql.cj.jdbc.ConnectionWrapper
-
- 所有已实现的接口:
JdbcConnection,MysqlConnection,TransactionEventHandler,AutoCloseable,Connection,Wrapper
public class ConnectionWrapper extends Object implements JdbcConnection
This class serves as a wrapper for the connection object. It is returned to the application server which may wrap it again and then return it to the application client in response to dataSource.getConnection(). All method invocations are forwarded to underlying connection unless the close method was previously called, in which case a SQLException is thrown. The close method performs a 'logical close' on the connection. All SQL exceptions thrown by the physical connection are intercepted and sent to connectionEvent listeners before being thrown to client.
-
-
字段概要
字段 修饰符和类型 字段 说明 protected ExceptionInterceptorexceptionInterceptorprotected JdbcConnectionmcprotected MysqlPooledConnectionpooledConnectionprotected Map<Class<?>,Object>unwrappedInterfaces
-
构造器概要
构造器 构造器 说明 ConnectionWrapper(MysqlPooledConnection mysqlPooledConnection, JdbcConnection mysqlConnection, boolean forXa)Construct a new LogicalHandle and set instance variables
-
方法概要
所有方法 静态方法 实例方法 具体方法 已过时的方法 修饰符和类型 方法 说明 voidabort(Executor executor)voidabortInternal()Clobbers the physical network connection and marks this connection as closed.voidchangeUser(String userName, String newPassword)Changes the user on this connection by performing a re-authentication.protected voidcheckAndFireConnectionError(SQLException sqlEx)Fires connection error event if required, before re-throwing exceptionvoidcheckClosed()voidcleanup(Throwable whyCleanedUp)Destroys this connection and any underlying resources.voidclearHasTriedMaster()已过时。voidclearWarnings()PreparedStatementclientPrepare(String sql)PreparedStatementclientPrepare(String sql, int resultSetType, int resultSetConcurrency)PreparedStatementclientPrepareStatement(String sql)Prepares a statement on the client, using client-side emulation (irregardless of the configuration property 'useServerPrepStmts') with the same semantics as the java.sql.Connection.prepareStatement() method with the same argument types.PreparedStatementclientPrepareStatement(String sql, int autoGenKeyIndex)Prepares a statement on the client, using client-side emulation (irregardless of the configuration property 'useServerPrepStmts') with the same semantics as the java.sql.Connection.prepareStatement() method with the same argument types.PreparedStatementclientPrepareStatement(String sql, int[] autoGenKeyIndexes)Prepares a statement on the client, using client-side emulation (irregardless of the configuration property 'useServerPrepStmts') with the same semantics as the java.sql.Connection.prepareStatement() method with the same argument types.PreparedStatementclientPrepareStatement(String sql, int resultSetType, int resultSetConcurrency)Prepares a statement on the client, using client-side emulation (irregardless of the configuration property 'useServerPrepStmts') with the same semantics as the java.sql.Connection.prepareStatement() method with the same argument types.PreparedStatementclientPrepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)Prepares a statement on the client, using client-side emulation (irregardless of the configuration property 'useServerPrepStmts') with the same semantics as the java.sql.Connection.prepareStatement() method with the same argument types.PreparedStatementclientPrepareStatement(String sql, String[] autoGenKeyColNames)Prepares a statement on the client, using client-side emulation (irregardless of the configuration property 'useServerPrepStmts') with the same semantics as the java.sql.Connection.prepareStatement() method with the same argument types.voidclose()The physical connection is not actually closed. the physical connection is closed when the application server calls mysqlPooledConnection.close(). this object is de-referenced by the pooled connection each time mysqlPooledConnection.getConnection() is called by app server.protected voidclose(boolean fireClosedEvent)voidcommit()ArraycreateArrayOf(String typeName, Object[] elements)BlobcreateBlob()ClobcreateClob()NClobcreateNClob()voidcreateNewIO(boolean isForReconnect)Creates an IO channel to the server.SQLXMLcreateSQLXML()StatementcreateStatement()StatementcreateStatement(int resultSetType, int resultSetConcurrency)StatementcreateStatement(int arg0, int arg1, int arg2)StructcreateStruct(String typeName, Object[] attributes)voiddecachePreparedStatement(JdbcPreparedStatement pstmt)JdbcConnectiongetActiveMySQLConnection()intgetActiveStatementCount()Returns the number of statements active on this connection, which haven't been .close()d.booleangetAutoCommit()intgetAutoIncrementIncrement()Returns the -session- value of 'auto_increment_increment' from the server if it exists, or '1' if not.CachedResultSetMetaDatagetCachedMetaData(String sql)Returns cached metadata (or null if not cached) for the given query, which must match _exactly_.StringgetCatalog()StringgetCharacterSetMetadata()PropertiesgetClientInfo()StringgetClientInfo(String name)ClientInfoProvidergetClientInfoProviderImpl()ObjectgetConnectionMutex()StringgetDatabase()Retrieves this connection object's current database name.ExceptionInterceptorgetExceptionInterceptor()intgetHoldability()StringgetHost()StringgetHostPortPair()longgetId()longgetIdleFor()Reports how long this connection has been idle.protected static ConnectionWrappergetInstance(MysqlPooledConnection mysqlPooledConnection, JdbcConnection mysqlConnection, boolean forXa)DatabaseMetaDatagetMetaData()StatementgetMetadataSafeStatement()JdbcConnectiongetMultiHostParentProxy()JdbcConnectiongetMultiHostSafeProxy()intgetNetworkTimeout()PropertiesgetProperties()Returns the parsed and passed in properties for this connection.JdbcPropertySetgetPropertySet()List<QueryInterceptor>getQueryInterceptorsInstances()StringgetSchema()ServerSessionStateControllergetServerSessionStateController()ServerVersiongetServerVersion()SessiongetSession()intgetSessionMaxRows()Returns the sql select limit max-rows for this session.StringgetStatementComment()Returns the comment that will be prepended to all statements sent to the server.intgetTransactionIsolation()Map<String,Class<?>>getTypeMap()StringgetURL()StringgetUser()SQLWarninggetWarnings()booleanhasSameProperties(JdbcConnection c)Does this connection have the same properties as another?booleanhasTriedMaster()已过时。voidinitializeResultsMetadataFromCache(String sql, CachedResultSetMetaData cachedMetaData, ResultSetInternalMethods resultSet)Caches CachedResultSetMetaData that has been placed in the cache using the given SQL as a key.voidinitializeSafeQueryInterceptors()booleanisClosed()booleanisInGlobalTx()Is this connection currently a participant in an XA transaction?booleanisProxySet()booleanisReadOnly()booleanisReadOnly(boolean useSessionStatus)Tests to see if the connection is in Read Only Mode.booleanisSameResource(JdbcConnection c)Does this connection have the same resource name as the given connection (for XA)?booleanisServerLocal()Is the server this connection is connected to "local" (i.e. same host) as the application?booleanisSourceConnection()Is this connection connected to the first host in the list if there is a list of servers in the URL?booleanisValid(int timeout)booleanisWrapperFor(Class<?> iface)booleanlowerCaseTableNames()Is the server configured to use lower-case table names only?StringnativeSQL(String sql)voidnormalClose()voidping()Detect if the connection is still good by sending a ping command to the server.voidpingInternal(boolean checkForClosedConnection, int timeoutMillis)CallableStatementprepareCall(String sql)CallableStatementprepareCall(String sql, int resultSetType, int resultSetConcurrency)CallableStatementprepareCall(String arg0, int arg1, int arg2, int arg3)PreparedStatementprepareStatement(String sql)PreparedStatementprepareStatement(String arg0, int arg1)PreparedStatementprepareStatement(String arg0, int[] arg1)PreparedStatementprepareStatement(String sql, int resultSetType, int resultSetConcurrency)PreparedStatementprepareStatement(String arg0, int arg1, int arg2, int arg3)PreparedStatementprepareStatement(String arg0, String[] arg1)voidrealClose(boolean calledExplicitly, boolean issueRollback, boolean skipLocalTeardown, Throwable reason)Closes connection and frees resources.voidrecachePreparedStatement(JdbcPreparedStatement pstmt)voidregisterStatement(JdbcStatement stmt)Register a Statement instance as open.voidreleaseSavepoint(Savepoint arg0)voidresetServerState()Resets the server-side state of this connection.voidrollback()voidrollback(Savepoint arg0)PreparedStatementserverPrepareStatement(String sql)Prepares a statement on the server (irregardless of the configuration property 'useServerPrepStmts') with the same semantics as the java.sql.Connection.prepareStatement() method with the same argument types.PreparedStatementserverPrepareStatement(String sql, int autoGenKeyIndex)Prepares a statement on the server (irregardless of the configuration property 'useServerPrepStmts') with the same semantics as the java.sql.Connection.prepareStatement() method with the same argument types.PreparedStatementserverPrepareStatement(String sql, int[] autoGenKeyIndexes)Prepares a statement on the server (irregardless of the configuration property 'useServerPrepStmts') with the same semantics as the java.sql.Connection.prepareStatement() method with the same argument types.PreparedStatementserverPrepareStatement(String sql, int resultSetType, int resultSetConcurrency)Prepares a statement on the server (irregardless of the configuration property 'useServerPrepStmts') with the same semantics as the java.sql.Connection.prepareStatement() method with the same argument types.PreparedStatementserverPrepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)Prepares a statement on the server (irregardless of the configuration property 'useServerPrepStmts') with the same semantics as the java.sql.Connection.prepareStatement() method with the same argument types.PreparedStatementserverPrepareStatement(String sql, String[] autoGenKeyColNames)Prepares a statement on the server (irregardless of the configuration property 'useServerPrepStmts') with the same semantics as the java.sql.Connection.prepareStatement() method with the same argument types.voidsetAutoCommit(boolean autoCommit)voidsetCatalog(String catalog)voidsetClientInfo(String name, String value)voidsetClientInfo(Properties properties)voidsetDatabase(String dbName)Set current database for this connection.voidsetFailedOver(boolean flag)voidsetHoldability(int arg0)voidsetInGlobalTx(boolean flag)Set the state of being in a global (XA) transaction.voidsetNetworkTimeout(Executor executor, int milliseconds)voidsetProxy(JdbcConnection conn)voidsetReadOnly(boolean readOnly)voidsetReadOnlyInternal(boolean readOnlyFlag)SavepointsetSavepoint()SavepointsetSavepoint(String arg0)voidsetSchema(String schema)voidsetSessionMaxRows(int max)Sets the sql select limit max-rows for this session if different from current.voidsetStatementComment(String comment)Sets the comment that will be prepended to all statements sent to the server.voidsetTransactionIsolation(int level)voidsetTypeMap(Map<String,Class<?>> map)voidshutdownServer()Used by MiniAdmin to shutdown a MySQL serverbooleanstoresLowerCaseTableName()voidthrowConnectionClosedException()voidtransactionBegun()voidtransactionCompleted()voidunregisterStatement(JdbcStatement stmt)Remove the given statement from the list of open statementsvoidunSafeQueryInterceptors()<T> Tunwrap(Class<T> iface)-
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
从接口继承的方法 java.sql.Connection
beginRequest, endRequest, setShardingKey, setShardingKey, setShardingKeyIfValid, setShardingKeyIfValid
-
从接口继承的方法 com.mysql.cj.jdbc.JdbcConnection
isMasterConnection
-
-
-
-
字段详细资料
-
mc
protected JdbcConnection mc
-
pooledConnection
protected MysqlPooledConnection pooledConnection
-
exceptionInterceptor
protected ExceptionInterceptor exceptionInterceptor
-
-
构造器详细资料
-
ConnectionWrapper
public ConnectionWrapper(MysqlPooledConnection mysqlPooledConnection, JdbcConnection mysqlConnection, boolean forXa) throws SQLException
Construct a new LogicalHandle and set instance variables- 参数:
mysqlPooledConnection- reference to object that instantiated this objectmysqlConnection- physical connection to dbforXa- is it for XA connection?- 抛出:
SQLException- if an error occurs.
-
-
方法详细资料
-
getInstance
protected static ConnectionWrapper getInstance(MysqlPooledConnection mysqlPooledConnection, JdbcConnection mysqlConnection, boolean forXa) throws SQLException
- 抛出:
SQLException
-
setAutoCommit
public void setAutoCommit(boolean autoCommit) throws SQLException- 指定者:
setAutoCommit在接口中Connection- 抛出:
SQLException
-
getAutoCommit
public boolean getAutoCommit() throws SQLException- 指定者:
getAutoCommit在接口中Connection- 抛出:
SQLException
-
setDatabase
public void setDatabase(String dbName) throws SQLException
从接口复制的说明:JdbcConnectionSet current database for this connection.- 指定者:
setDatabase在接口中JdbcConnection- 参数:
dbName- the database for this connection to use- 抛出:
SQLException- if a database access error occurs
-
getDatabase
public String getDatabase() throws SQLException
从接口复制的说明:JdbcConnectionRetrieves this connection object's current database name.- 指定者:
getDatabase在接口中JdbcConnection- 返回:
- current database name
- 抛出:
SQLException- if an error occurs
-
setCatalog
public void setCatalog(String catalog) throws SQLException
- 指定者:
setCatalog在接口中Connection- 抛出:
SQLException
-
getCatalog
public String getCatalog() throws SQLException
- 指定者:
getCatalog在接口中Connection- 抛出:
SQLException
-
isClosed
public boolean isClosed() throws SQLException- 指定者:
isClosed在接口中Connection- 抛出:
SQLException
-
isSourceConnection
public boolean isSourceConnection()
从接口复制的说明:JdbcConnectionIs this connection connected to the first host in the list if there is a list of servers in the URL?- 指定者:
isSourceConnection在接口中JdbcConnection- 返回:
- true if this connection is connected to the first in the list.
-
setHoldability
public void setHoldability(int arg0) throws SQLException- 指定者:
setHoldability在接口中Connection- 抛出:
SQLException
-
getHoldability
public int getHoldability() throws SQLException- 指定者:
getHoldability在接口中Connection- 抛出:
SQLException
-
getIdleFor
public long getIdleFor()
从接口复制的说明:JdbcConnectionReports how long this connection has been idle. This time (reported in milliseconds) is updated once a query has completed.- 指定者:
getIdleFor在接口中JdbcConnection- 返回:
- number of ms that this connection has been idle, 0 if the driver is busy retrieving results.
-
getMetaData
public DatabaseMetaData getMetaData() throws SQLException
- 指定者:
getMetaData在接口中Connection- 抛出:
SQLException
-
setReadOnly
public void setReadOnly(boolean readOnly) throws SQLException- 指定者:
setReadOnly在接口中Connection- 抛出:
SQLException
-
isReadOnly
public boolean isReadOnly() throws SQLException- 指定者:
isReadOnly在接口中Connection- 抛出:
SQLException
-
setSavepoint
public Savepoint setSavepoint() throws SQLException
- 指定者:
setSavepoint在接口中Connection- 抛出:
SQLException
-
setSavepoint
public Savepoint setSavepoint(String arg0) throws SQLException
- 指定者:
setSavepoint在接口中Connection- 抛出:
SQLException
-
setTransactionIsolation
public void setTransactionIsolation(int level) throws SQLException- 指定者:
setTransactionIsolation在接口中Connection- 抛出:
SQLException
-
getTransactionIsolation
public int getTransactionIsolation() throws SQLException- 指定者:
getTransactionIsolation在接口中Connection- 抛出:
SQLException
-
getTypeMap
public Map<String,Class<?>> getTypeMap() throws SQLException
- 指定者:
getTypeMap在接口中Connection- 抛出:
SQLException
-
getWarnings
public SQLWarning getWarnings() throws SQLException
- 指定者:
getWarnings在接口中Connection- 抛出:
SQLException
-
clearWarnings
public void clearWarnings() throws SQLException- 指定者:
clearWarnings在接口中Connection- 抛出:
SQLException
-
close
public void close() throws SQLExceptionThe physical connection is not actually closed. the physical connection is closed when the application server calls mysqlPooledConnection.close(). this object is de-referenced by the pooled connection each time mysqlPooledConnection.getConnection() is called by app server.- 指定者:
close在接口中AutoCloseable- 指定者:
close在接口中Connection- 抛出:
SQLException- if an error occurs
-
commit
public void commit() throws SQLException- 指定者:
commit在接口中Connection- 抛出:
SQLException
-
createStatement
public Statement createStatement() throws SQLException
- 指定者:
createStatement在接口中Connection- 抛出:
SQLException
-
createStatement
public Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException
- 指定者:
createStatement在接口中Connection- 抛出:
SQLException
-
createStatement
public Statement createStatement(int arg0, int arg1, int arg2) throws SQLException
- 指定者:
createStatement在接口中Connection- 抛出:
SQLException
-
nativeSQL
public String nativeSQL(String sql) throws SQLException
- 指定者:
nativeSQL在接口中Connection- 抛出:
SQLException
-
prepareCall
public CallableStatement prepareCall(String sql) throws SQLException
- 指定者:
prepareCall在接口中Connection- 抛出:
SQLException
-
prepareCall
public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) throws SQLException
- 指定者:
prepareCall在接口中Connection- 抛出:
SQLException
-
prepareCall
public CallableStatement prepareCall(String arg0, int arg1, int arg2, int arg3) throws SQLException
- 指定者:
prepareCall在接口中Connection- 抛出:
SQLException
-
clientPrepare
public PreparedStatement clientPrepare(String sql) throws SQLException
- 抛出:
SQLException
-
clientPrepare
public PreparedStatement clientPrepare(String sql, int resultSetType, int resultSetConcurrency) throws SQLException
- 抛出:
SQLException
-
prepareStatement
public PreparedStatement prepareStatement(String sql) throws SQLException
- 指定者:
prepareStatement在接口中Connection- 抛出:
SQLException
-
prepareStatement
public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException
- 指定者:
prepareStatement在接口中Connection- 抛出:
SQLException
-
prepareStatement
public PreparedStatement prepareStatement(String arg0, int arg1, int arg2, int arg3) throws SQLException
- 指定者:
prepareStatement在接口中Connection- 抛出:
SQLException
-
prepareStatement
public PreparedStatement prepareStatement(String arg0, int arg1) throws SQLException
- 指定者:
prepareStatement在接口中Connection- 抛出:
SQLException
-
prepareStatement
public PreparedStatement prepareStatement(String arg0, int[] arg1) throws SQLException
- 指定者:
prepareStatement在接口中Connection- 抛出:
SQLException
-
prepareStatement
public PreparedStatement prepareStatement(String arg0, String[] arg1) throws SQLException
- 指定者:
prepareStatement在接口中Connection- 抛出:
SQLException
-
releaseSavepoint
public void releaseSavepoint(Savepoint arg0) throws SQLException
- 指定者:
releaseSavepoint在接口中Connection- 抛出:
SQLException
-
rollback
public void rollback() throws SQLException- 指定者:
rollback在接口中Connection- 抛出:
SQLException
-
rollback
public void rollback(Savepoint arg0) throws SQLException
- 指定者:
rollback在接口中Connection- 抛出:
SQLException
-
isSameResource
public boolean isSameResource(JdbcConnection c)
从接口复制的说明:JdbcConnectionDoes this connection have the same resource name as the given connection (for XA)?- 指定者:
isSameResource在接口中JdbcConnection- 参数:
c- connection- 返回:
- true if it is the same one
-
close
protected void close(boolean fireClosedEvent) throws SQLException- 抛出:
SQLException
-
checkClosed
public void checkClosed()
- 指定者:
checkClosed在接口中MysqlConnection
-
isInGlobalTx
public boolean isInGlobalTx()
从接口复制的说明:JdbcConnectionIs this connection currently a participant in an XA transaction?- 指定者:
isInGlobalTx在接口中JdbcConnection- 返回:
- true if this connection currently a participant in an XA transaction
-
setInGlobalTx
public void setInGlobalTx(boolean flag)
从接口复制的说明:JdbcConnectionSet the state of being in a global (XA) transaction.- 指定者:
setInGlobalTx在接口中JdbcConnection- 参数:
flag- the state flag
-
ping
public void ping() throws SQLException从接口复制的说明:JdbcConnectionDetect if the connection is still good by sending a ping command to the server.- 指定者:
ping在接口中JdbcConnection- 抛出:
SQLException- if the ping fails
-
changeUser
public void changeUser(String userName, String newPassword) throws SQLException
从接口复制的说明:JdbcConnectionChanges the user on this connection by performing a re-authentication. If authentication fails, the connection is failed.- 指定者:
changeUser在接口中JdbcConnection- 参数:
userName- the username to authenticate withnewPassword- the password to authenticate with- 抛出:
SQLException- if authentication fails, or some other error occurs while performing the command.
-
clearHasTriedMaster
@Deprecated public void clearHasTriedMaster()
已过时。- 指定者:
clearHasTriedMaster在接口中JdbcConnection
-
clientPrepareStatement
public PreparedStatement clientPrepareStatement(String sql) throws SQLException
从接口复制的说明:JdbcConnectionPrepares a statement on the client, using client-side emulation (irregardless of the configuration property 'useServerPrepStmts') with the same semantics as the java.sql.Connection.prepareStatement() method with the same argument types.- 指定者:
clientPrepareStatement在接口中JdbcConnection- 参数:
sql- statement- 返回:
- prepared statement
- 抛出:
SQLException- if an error occurs- 另请参阅:
Connection.prepareStatement(String)
-
clientPrepareStatement
public PreparedStatement clientPrepareStatement(String sql, int autoGenKeyIndex) throws SQLException
从接口复制的说明:JdbcConnectionPrepares a statement on the client, using client-side emulation (irregardless of the configuration property 'useServerPrepStmts') with the same semantics as the java.sql.Connection.prepareStatement() method with the same argument types.- 指定者:
clientPrepareStatement在接口中JdbcConnection- 参数:
sql- statementautoGenKeyIndex- autoGenKeyIndex- 返回:
- prepared statement
- 抛出:
SQLException- if an error occurs- 另请参阅:
Connection.prepareStatement(String, int)
-
clientPrepareStatement
public PreparedStatement clientPrepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException
从接口复制的说明:JdbcConnectionPrepares a statement on the client, using client-side emulation (irregardless of the configuration property 'useServerPrepStmts') with the same semantics as the java.sql.Connection.prepareStatement() method with the same argument types.- 指定者:
clientPrepareStatement在接口中JdbcConnection- 参数:
sql- statementresultSetType- resultSetTyperesultSetConcurrency- resultSetConcurrency- 返回:
- prepared statement
- 抛出:
SQLException- if an error occurs- 另请参阅:
Connection.prepareStatement(String, int, int)
-
clientPrepareStatement
public PreparedStatement clientPrepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
从接口复制的说明:JdbcConnectionPrepares a statement on the client, using client-side emulation (irregardless of the configuration property 'useServerPrepStmts') with the same semantics as the java.sql.Connection.prepareStatement() method with the same argument types.- 指定者:
clientPrepareStatement在接口中JdbcConnection- 参数:
sql- statementresultSetType- resultSetTyperesultSetConcurrency- resultSetConcurrencyresultSetHoldability- resultSetHoldability- 返回:
- prepared statement
- 抛出:
SQLException- if an error occurs- 另请参阅:
Connection.prepareStatement(String, int, int, int)
-
clientPrepareStatement
public PreparedStatement clientPrepareStatement(String sql, int[] autoGenKeyIndexes) throws SQLException
从接口复制的说明:JdbcConnectionPrepares a statement on the client, using client-side emulation (irregardless of the configuration property 'useServerPrepStmts') with the same semantics as the java.sql.Connection.prepareStatement() method with the same argument types.- 指定者:
clientPrepareStatement在接口中JdbcConnection- 参数:
sql- statementautoGenKeyIndexes- autoGenKeyIndexes- 返回:
- prepared statement
- 抛出:
SQLException- if an error occurs- 另请参阅:
Connection.prepareStatement(String, int[])
-
clientPrepareStatement
public PreparedStatement clientPrepareStatement(String sql, String[] autoGenKeyColNames) throws SQLException
从接口复制的说明:JdbcConnectionPrepares a statement on the client, using client-side emulation (irregardless of the configuration property 'useServerPrepStmts') with the same semantics as the java.sql.Connection.prepareStatement() method with the same argument types.- 指定者:
clientPrepareStatement在接口中JdbcConnection- 参数:
sql- statementautoGenKeyColNames- autoGenKeyColNames- 返回:
- prepared statement
- 抛出:
SQLException- if an error occurs- 另请参阅:
Connection.prepareStatement(String, String[])
-
getActiveStatementCount
public int getActiveStatementCount()
从接口复制的说明:JdbcConnectionReturns the number of statements active on this connection, which haven't been .close()d.- 指定者:
getActiveStatementCount在接口中JdbcConnection- 返回:
- the number of active statements
-
getStatementComment
public String getStatementComment()
从接口复制的说明:JdbcConnectionReturns the comment that will be prepended to all statements sent to the server.- 指定者:
getStatementComment在接口中JdbcConnection- 返回:
- the comment that will be prepended to all statements sent to the server.
-
hasTriedMaster
@Deprecated public boolean hasTriedMaster()
已过时。从接口复制的说明:JdbcConnectionHas this connection tried to execute a query on the "source" server (first host in a multiple host list).- 指定者:
hasTriedMaster在接口中JdbcConnection- 返回:
- true if it has tried
-
lowerCaseTableNames
public boolean lowerCaseTableNames()
从接口复制的说明:JdbcConnectionIs the server configured to use lower-case table names only?- 指定者:
lowerCaseTableNames在接口中JdbcConnection- 返回:
- true if lower_case_table_names is 'on'
-
resetServerState
public void resetServerState() throws SQLException从接口复制的说明:JdbcConnectionResets the server-side state of this connection. Doesn't work if isParanoid() is set (it will become a no-op in this case). Usually only used from connection pooling code.- 指定者:
resetServerState在接口中JdbcConnection- 抛出:
SQLException- if the operation fails while resetting server state.
-
serverPrepareStatement
public PreparedStatement serverPrepareStatement(String sql) throws SQLException
从接口复制的说明:JdbcConnectionPrepares a statement on the server (irregardless of the configuration property 'useServerPrepStmts') with the same semantics as the java.sql.Connection.prepareStatement() method with the same argument types.- 指定者:
serverPrepareStatement在接口中JdbcConnection- 参数:
sql- statement- 返回:
- prepared statement
- 抛出:
SQLException- if an error occurs- 另请参阅:
Connection.prepareStatement(String)
-
serverPrepareStatement
public PreparedStatement serverPrepareStatement(String sql, int autoGenKeyIndex) throws SQLException
从接口复制的说明:JdbcConnectionPrepares a statement on the server (irregardless of the configuration property 'useServerPrepStmts') with the same semantics as the java.sql.Connection.prepareStatement() method with the same argument types.- 指定者:
serverPrepareStatement在接口中JdbcConnection- 参数:
sql- statementautoGenKeyIndex- autoGenKeyIndex- 返回:
- prepared statement
- 抛出:
SQLException- if an error occurs- 另请参阅:
Connection.prepareStatement(String, int)
-
serverPrepareStatement
public PreparedStatement serverPrepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException
从接口复制的说明:JdbcConnectionPrepares a statement on the server (irregardless of the configuration property 'useServerPrepStmts') with the same semantics as the java.sql.Connection.prepareStatement() method with the same argument types.- 指定者:
serverPrepareStatement在接口中JdbcConnection- 参数:
sql- statementresultSetType- resultSetTyperesultSetConcurrency- resultSetConcurrency- 返回:
- prepared statement
- 抛出:
SQLException- if an error occurs- 另请参阅:
Connection.prepareStatement(String, int, int)
-
serverPrepareStatement
public PreparedStatement serverPrepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
从接口复制的说明:JdbcConnectionPrepares a statement on the server (irregardless of the configuration property 'useServerPrepStmts') with the same semantics as the java.sql.Connection.prepareStatement() method with the same argument types.- 指定者:
serverPrepareStatement在接口中JdbcConnection- 参数:
sql- statementresultSetType- resultSetTyperesultSetConcurrency- resultSetConcurrencyresultSetHoldability- resultSetHoldability- 返回:
- prepared statement
- 抛出:
SQLException- if an error occurs- 另请参阅:
Connection.prepareStatement(String, int, int, int)
-
serverPrepareStatement
public PreparedStatement serverPrepareStatement(String sql, int[] autoGenKeyIndexes) throws SQLException
从接口复制的说明:JdbcConnectionPrepares a statement on the server (irregardless of the configuration property 'useServerPrepStmts') with the same semantics as the java.sql.Connection.prepareStatement() method with the same argument types.- 指定者:
serverPrepareStatement在接口中JdbcConnection- 参数:
sql- statementautoGenKeyIndexes- autoGenKeyIndexes- 返回:
- prepared statement
- 抛出:
SQLException- if an error occurs- 另请参阅:
Connection.prepareStatement(String, int[])
-
serverPrepareStatement
public PreparedStatement serverPrepareStatement(String sql, String[] autoGenKeyColNames) throws SQLException
从接口复制的说明:JdbcConnectionPrepares a statement on the server (irregardless of the configuration property 'useServerPrepStmts') with the same semantics as the java.sql.Connection.prepareStatement() method with the same argument types.- 指定者:
serverPrepareStatement在接口中JdbcConnection- 参数:
sql- statementautoGenKeyColNames- autoGenKeyColNames- 返回:
- prepared statement
- 抛出:
SQLException- if an error occurs- 另请参阅:
Connection.prepareStatement(String, String[])
-
setFailedOver
public void setFailedOver(boolean flag)
- 指定者:
setFailedOver在接口中JdbcConnection- 参数:
flag- The failedOver flag to set.
-
setStatementComment
public void setStatementComment(String comment)
从接口复制的说明:JdbcConnectionSets the comment that will be prepended to all statements sent to the server. Do not use slash-star or star-slash tokens in the comment as these will be added by the driver itself.- 指定者:
setStatementComment在接口中JdbcConnection- 参数:
comment- the comment that will be prepended to all statements sent to the server.
-
shutdownServer
public void shutdownServer() throws SQLException从接口复制的说明:JdbcConnectionUsed by MiniAdmin to shutdown a MySQL server- 指定者:
shutdownServer在接口中JdbcConnection- 抛出:
SQLException- if the command can not be issued.
-
getAutoIncrementIncrement
public int getAutoIncrementIncrement()
从接口复制的说明:JdbcConnectionReturns the -session- value of 'auto_increment_increment' from the server if it exists, or '1' if not.- 指定者:
getAutoIncrementIncrement在接口中JdbcConnection- 返回:
- the -session- value of 'auto_increment_increment'
-
getExceptionInterceptor
public ExceptionInterceptor getExceptionInterceptor()
- 指定者:
getExceptionInterceptor在接口中MysqlConnection
-
hasSameProperties
public boolean hasSameProperties(JdbcConnection c)
从接口复制的说明:JdbcConnectionDoes this connection have the same properties as another?- 指定者:
hasSameProperties在接口中JdbcConnection- 参数:
c- connection- 返回:
- true if has the same properties
-
getProperties
public Properties getProperties()
从接口复制的说明:MysqlConnectionReturns the parsed and passed in properties for this connection.- 指定者:
getProperties在接口中MysqlConnection- 返回:
Properties
-
getHost
public String getHost()
- 指定者:
getHost在接口中JdbcConnection
-
setProxy
public void setProxy(JdbcConnection conn)
- 指定者:
setProxy在接口中JdbcConnection
-
setTypeMap
public void setTypeMap(Map<String,Class<?>> map) throws SQLException
- 指定者:
setTypeMap在接口中Connection- 抛出:
SQLException
-
isServerLocal
public boolean isServerLocal() throws SQLException从接口复制的说明:JdbcConnectionIs the server this connection is connected to "local" (i.e. same host) as the application?- 指定者:
isServerLocal在接口中JdbcConnection- 返回:
- true if the server is "local"
- 抛出:
SQLException- if an error occurs
-
setSchema
public void setSchema(String schema) throws SQLException
- 指定者:
setSchema在接口中Connection- 抛出:
SQLException
-
getSchema
public String getSchema() throws SQLException
- 指定者:
getSchema在接口中Connection- 抛出:
SQLException
-
abort
public void abort(Executor executor) throws SQLException
- 指定者:
abort在接口中Connection- 抛出:
SQLException
-
setNetworkTimeout
public void setNetworkTimeout(Executor executor, int milliseconds) throws SQLException
- 指定者:
setNetworkTimeout在接口中Connection- 抛出:
SQLException
-
getNetworkTimeout
public int getNetworkTimeout() throws SQLException- 指定者:
getNetworkTimeout在接口中Connection- 抛出:
SQLException
-
abortInternal
public void abortInternal() throws SQLException从接口复制的说明:JdbcConnectionClobbers the physical network connection and marks this connection as closed.- 指定者:
abortInternal在接口中JdbcConnection- 抛出:
SQLException- if an error occurs
-
getConnectionMutex
public Object getConnectionMutex()
- 指定者:
getConnectionMutex在接口中MysqlConnection
-
getSessionMaxRows
public int getSessionMaxRows()
从接口复制的说明:JdbcConnectionReturns the sql select limit max-rows for this session.- 指定者:
getSessionMaxRows在接口中JdbcConnection- 返回:
- int max rows
-
setSessionMaxRows
public void setSessionMaxRows(int max) throws SQLException从接口复制的说明:JdbcConnectionSets the sql select limit max-rows for this session if different from current.- 指定者:
setSessionMaxRows在接口中JdbcConnection- 参数:
max- the new max-rows value to set.- 抛出:
SQLException- if a database error occurs issuing the statement that sets the limit.
-
createClob
public Clob createClob() throws SQLException
- 指定者:
createClob在接口中Connection- 抛出:
SQLException
-
createBlob
public Blob createBlob() throws SQLException
- 指定者:
createBlob在接口中Connection- 抛出:
SQLException
-
createNClob
public NClob createNClob() throws SQLException
- 指定者:
createNClob在接口中Connection- 抛出:
SQLException
-
createSQLXML
public SQLXML createSQLXML() throws SQLException
- 指定者:
createSQLXML在接口中Connection- 抛出:
SQLException
-
isValid
public boolean isValid(int timeout) throws SQLException- 指定者:
isValid在接口中Connection- 抛出:
SQLException
-
setClientInfo
public void setClientInfo(String name, String value) throws SQLClientInfoException
- 指定者:
setClientInfo在接口中Connection- 抛出:
SQLClientInfoException
-
setClientInfo
public void setClientInfo(Properties properties) throws SQLClientInfoException
- 指定者:
setClientInfo在接口中Connection- 抛出:
SQLClientInfoException
-
getClientInfo
public String getClientInfo(String name) throws SQLException
- 指定者:
getClientInfo在接口中Connection- 抛出:
SQLException
-
getClientInfo
public Properties getClientInfo() throws SQLException
- 指定者:
getClientInfo在接口中Connection- 抛出:
SQLException
-
createArrayOf
public Array createArrayOf(String typeName, Object[] elements) throws SQLException
- 指定者:
createArrayOf在接口中Connection- 抛出:
SQLException
-
createStruct
public Struct createStruct(String typeName, Object[] attributes) throws SQLException
- 指定者:
createStruct在接口中Connection- 抛出:
SQLException
-
unwrap
public <T> T unwrap(Class<T> iface) throws SQLException
- 指定者:
unwrap在接口中Wrapper- 抛出:
SQLException
-
isWrapperFor
public boolean isWrapperFor(Class<?> iface) throws SQLException
- 指定者:
isWrapperFor在接口中Wrapper- 抛出:
SQLException
-
getSession
public Session getSession()
- 指定者:
getSession在接口中MysqlConnection
-
getId
public long getId()
- 指定者:
getId在接口中MysqlConnection
-
getURL
public String getURL()
- 指定者:
getURL在接口中MysqlConnection
-
getUser
public String getUser()
- 指定者:
getUser在接口中MysqlConnection
-
createNewIO
public void createNewIO(boolean isForReconnect)
从接口复制的说明:MysqlConnectionCreates an IO channel to the server.- 指定者:
createNewIO在接口中MysqlConnection- 参数:
isForReconnect- is this request for a re-connect
-
isProxySet
public boolean isProxySet()
- 指定者:
isProxySet在接口中JdbcConnection
-
getPropertySet
public JdbcPropertySet getPropertySet()
- 指定者:
getPropertySet在接口中JdbcConnection- 指定者:
getPropertySet在接口中MysqlConnection
-
getCachedMetaData
public CachedResultSetMetaData getCachedMetaData(String sql)
从接口复制的说明:JdbcConnectionReturns cached metadata (or null if not cached) for the given query, which must match _exactly_. This method is synchronized by the caller on getMutex(), so if calling this method from internal code in the driver, make sure it's synchronized on the mutex that guards communication with the server.- 指定者:
getCachedMetaData在接口中JdbcConnection- 参数:
sql- the query that is the key to the cache- 返回:
- metadata cached for the given SQL, or none if it doesn't exist.
-
getCharacterSetMetadata
public String getCharacterSetMetadata()
- 指定者:
getCharacterSetMetadata在接口中JdbcConnection- 返回:
- Returns the characterSetMetadata.
-
getMetadataSafeStatement
public Statement getMetadataSafeStatement() throws SQLException
- 指定者:
getMetadataSafeStatement在接口中JdbcConnection- 抛出:
SQLException
-
getServerVersion
public ServerVersion getServerVersion()
- 指定者:
getServerVersion在接口中JdbcConnection
-
getQueryInterceptorsInstances
public List<QueryInterceptor> getQueryInterceptorsInstances()
- 指定者:
getQueryInterceptorsInstances在接口中JdbcConnection
-
initializeResultsMetadataFromCache
public void initializeResultsMetadataFromCache(String sql, CachedResultSetMetaData cachedMetaData, ResultSetInternalMethods resultSet) throws SQLException
从接口复制的说明:JdbcConnectionCaches CachedResultSetMetaData that has been placed in the cache using the given SQL as a key. This method is synchronized by the caller on getMutex(), so if calling this method from internal code in the driver, make sure it's synchronized on the mutex that guards communication with the server.- 指定者:
initializeResultsMetadataFromCache在接口中JdbcConnection- 参数:
sql- the query that the metadata pertains too.cachedMetaData- metadata (if it exists) to populate the cache.resultSet- the result set to retreive metadata from, or apply to.- 抛出:
SQLException- if an error occurs
-
initializeSafeQueryInterceptors
public void initializeSafeQueryInterceptors() throws SQLException- 指定者:
initializeSafeQueryInterceptors在接口中JdbcConnection- 抛出:
SQLException
-
isReadOnly
public boolean isReadOnly(boolean useSessionStatus) throws SQLException从接口复制的说明:JdbcConnectionTests to see if the connection is in Read Only Mode.- 指定者:
isReadOnly在接口中JdbcConnection- 参数:
useSessionStatus- in some cases, for example when restoring connection with autoReconnect=true, we can rely only on saved readOnly state, so use useSessionStatus=false in that case- 返回:
- true if the connection is read only
- 抛出:
SQLException- if a database access error occurs
-
pingInternal
public void pingInternal(boolean checkForClosedConnection, int timeoutMillis) throws SQLException- 指定者:
pingInternal在接口中JdbcConnection- 抛出:
SQLException
-
realClose
public void realClose(boolean calledExplicitly, boolean issueRollback, boolean skipLocalTeardown, Throwable reason) throws SQLException从接口复制的说明:JdbcConnectionCloses connection and frees resources.- 指定者:
realClose在接口中JdbcConnection- 参数:
calledExplicitly- is this being called from close()issueRollback- should a rollback() be issued?skipLocalTeardown- if true, driver tries to close connection normally, performing rollbacks, closing open statements etc; otherwise the force close is performedreason- the exception caused this method call- 抛出:
SQLException- if an error occurs
-
recachePreparedStatement
public void recachePreparedStatement(JdbcPreparedStatement pstmt) throws SQLException
- 指定者:
recachePreparedStatement在接口中JdbcConnection- 抛出:
SQLException
-
decachePreparedStatement
public void decachePreparedStatement(JdbcPreparedStatement pstmt) throws SQLException
- 指定者:
decachePreparedStatement在接口中JdbcConnection- 抛出:
SQLException
-
registerStatement
public void registerStatement(JdbcStatement stmt)
从接口复制的说明:JdbcConnectionRegister a Statement instance as open.- 指定者:
registerStatement在接口中JdbcConnection- 参数:
stmt- the Statement instance to remove
-
setReadOnlyInternal
public void setReadOnlyInternal(boolean readOnlyFlag) throws SQLException- 指定者:
setReadOnlyInternal在接口中JdbcConnection- 抛出:
SQLException
-
storesLowerCaseTableName
public boolean storesLowerCaseTableName()
- 指定者:
storesLowerCaseTableName在接口中JdbcConnection
-
throwConnectionClosedException
public void throwConnectionClosedException() throws SQLException- 指定者:
throwConnectionClosedException在接口中JdbcConnection- 抛出:
SQLException
-
transactionBegun
public void transactionBegun()
- 指定者:
transactionBegun在接口中TransactionEventHandler
-
transactionCompleted
public void transactionCompleted()
- 指定者:
transactionCompleted在接口中TransactionEventHandler
-
unregisterStatement
public void unregisterStatement(JdbcStatement stmt)
从接口复制的说明:JdbcConnectionRemove the given statement from the list of open statements- 指定者:
unregisterStatement在接口中JdbcConnection- 参数:
stmt- the Statement instance to remove
-
unSafeQueryInterceptors
public void unSafeQueryInterceptors() throws SQLException- 指定者:
unSafeQueryInterceptors在接口中JdbcConnection- 抛出:
SQLException
-
getMultiHostSafeProxy
public JdbcConnection getMultiHostSafeProxy()
- 指定者:
getMultiHostSafeProxy在接口中JdbcConnection
-
getMultiHostParentProxy
public JdbcConnection getMultiHostParentProxy()
- 指定者:
getMultiHostParentProxy在接口中JdbcConnection
-
getActiveMySQLConnection
public JdbcConnection getActiveMySQLConnection()
- 指定者:
getActiveMySQLConnection在接口中JdbcConnection
-
getClientInfoProviderImpl
public ClientInfoProvider getClientInfoProviderImpl() throws SQLException
- 指定者:
getClientInfoProviderImpl在接口中JdbcConnection- 抛出:
SQLException
-
getHostPortPair
public String getHostPortPair()
- 指定者:
getHostPortPair在接口中JdbcConnection
-
normalClose
public void normalClose()
- 指定者:
normalClose在接口中MysqlConnection
-
cleanup
public void cleanup(Throwable whyCleanedUp)
从接口复制的说明:MysqlConnectionDestroys this connection and any underlying resources.- 指定者:
cleanup在接口中MysqlConnection- 参数:
whyCleanedUp- exception caused the connection clean up
-
getServerSessionStateController
public ServerSessionStateController getServerSessionStateController()
-
checkAndFireConnectionError
protected void checkAndFireConnectionError(SQLException sqlEx) throws SQLException
Fires connection error event if required, before re-throwing exception- 参数:
sqlEx- the SQLException that has occurred- 抛出:
SQLException- (rethrown)
-
-