类 MultiHostMySQLConnection
- java.lang.Object
-
- com.mysql.cj.jdbc.ha.MultiHostMySQLConnection
-
- 所有已实现的接口:
JdbcConnection,MysqlConnection,TransactionEventHandler,AutoCloseable,Connection,Wrapper
public class MultiHostMySQLConnection extends Object implements JdbcConnection
Each instance of MultiHostMySQLConnection is coupled with a MultiHostConnectionProxy instance. While this class implements MySQLConnection directly, MultiHostConnectionProxy does the same but via a dynamic proxy. Most of the methods in this class refer directly to the active connection from its MultiHostConnectionProxy pair, providing a non-proxied access to the current active connection managed by this multi-host structure. The remaining methods either implement some local behavior or refer to the proxy itself instead of the sub-connection. Referring to the higher level proxy connection is needed when some operation needs to be extended to all open sub-connections existing in this multi-host structure as opposed to just refer to the active current connection, such as with close() which is most likely required to close all sub-connections as well.
-
-
字段概要
字段 修饰符和类型 字段 说明 protected MultiHostConnectionProxythisAsProxythisAsProxy holds the proxy (MultiHostConnectionProxy or one of its subclasses) this connection is associated with.
-
构造器概要
构造器 构造器 说明 MultiHostMySQLConnection(MultiHostConnectionProxy proxy)
-
方法概要
所有方法 实例方法 具体方法 已过时的方法 修饰符和类型 方法 说明 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.voidcheckClosed()voidcleanup(Throwable whyCleanedUp)Destroys this connection and any underlying resources.voidclearHasTriedMaster()已过时。voidclearWarnings()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()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 resultSetType, int resultSetConcurrency, int resultSetHoldability)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.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.MultiHostConnectionProxygetThisAsProxy()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 otherConnection)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 sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)PreparedStatementprepareStatement(String sql)PreparedStatementprepareStatement(String sql, int autoGenKeyIndex)PreparedStatementprepareStatement(String sql, int[] autoGenKeyIndexes)PreparedStatementprepareStatement(String sql, int resultSetType, int resultSetConcurrency)PreparedStatementprepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)PreparedStatementprepareStatement(String sql, String[] autoGenKeyColNames)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 savepoint)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 autoCommitFlag)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 proxy)voidsetReadOnly(boolean readOnlyFlag)voidsetReadOnlyInternal(boolean readOnlyFlag)SavepointsetSavepoint()SavepointsetSavepoint(String name)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
-
-
-
-
字段详细资料
-
thisAsProxy
protected MultiHostConnectionProxy thisAsProxy
thisAsProxy holds the proxy (MultiHostConnectionProxy or one of its subclasses) this connection is associated with. It is used as a gateway to the current active sub-connection managed by this multi-host structure or as a target to where some of the methods implemented here in this class refer to.
-
-
构造器详细资料
-
MultiHostMySQLConnection
public MultiHostMySQLConnection(MultiHostConnectionProxy proxy)
-
-
方法详细资料
-
getThisAsProxy
public MultiHostConnectionProxy getThisAsProxy()
-
getActiveMySQLConnection
public JdbcConnection getActiveMySQLConnection()
- 指定者:
getActiveMySQLConnection在接口中JdbcConnection
-
abortInternal
public void abortInternal() throws SQLException从接口复制的说明:JdbcConnectionClobbers the physical network connection and marks this connection as closed.- 指定者:
abortInternal在接口中JdbcConnection- 抛出:
SQLException- if an error occurs
-
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.
-
checkClosed
public void checkClosed()
- 指定者:
checkClosed在接口中MysqlConnection
-
clearHasTriedMaster
@Deprecated public void clearHasTriedMaster()
已过时。- 指定者:
clearHasTriedMaster在接口中JdbcConnection
-
clearWarnings
public void clearWarnings() throws SQLException- 指定者:
clearWarnings在接口中Connection- 抛出:
SQLException
-
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 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 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[] 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[])
-
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)
-
close
public void close() throws SQLException- 指定者:
close在接口中AutoCloseable- 指定者:
close在接口中Connection- 抛出:
SQLException
-
commit
public void commit() throws SQLException- 指定者:
commit在接口中Connection- 抛出:
SQLException
-
createNewIO
public void createNewIO(boolean isForReconnect)
从接口复制的说明:MysqlConnectionCreates an IO channel to the server.- 指定者:
createNewIO在接口中MysqlConnection- 参数:
isForReconnect- is this request for a re-connect
-
createStatement
public Statement createStatement() throws SQLException
- 指定者:
createStatement在接口中Connection- 抛出:
SQLException
-
createStatement
public Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
- 指定者:
createStatement在接口中Connection- 抛出:
SQLException
-
createStatement
public Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException
- 指定者:
createStatement在接口中Connection- 抛出:
SQLException
-
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
-
getAutoCommit
public boolean getAutoCommit() throws SQLException- 指定者:
getAutoCommit在接口中Connection- 抛出:
SQLException
-
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'
-
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.
-
getCatalog
public String getCatalog() throws SQLException
- 指定者:
getCatalog在接口中Connection- 抛出:
SQLException
-
getCharacterSetMetadata
public String getCharacterSetMetadata()
- 指定者:
getCharacterSetMetadata在接口中JdbcConnection- 返回:
- Returns the characterSetMetadata.
-
getExceptionInterceptor
public ExceptionInterceptor getExceptionInterceptor()
- 指定者:
getExceptionInterceptor在接口中MysqlConnection
-
getHoldability
public int getHoldability() throws SQLException- 指定者:
getHoldability在接口中Connection- 抛出:
SQLException
-
getHost
public String getHost()
- 指定者:
getHost在接口中JdbcConnection
-
getId
public long getId()
- 指定者:
getId在接口中MysqlConnection
-
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.
-
getMultiHostSafeProxy
public JdbcConnection getMultiHostSafeProxy()
- 指定者:
getMultiHostSafeProxy在接口中JdbcConnection
-
getMultiHostParentProxy
public JdbcConnection getMultiHostParentProxy()
- 指定者:
getMultiHostParentProxy在接口中JdbcConnection
-
getMetaData
public DatabaseMetaData getMetaData() throws SQLException
- 指定者:
getMetaData在接口中Connection- 抛出:
SQLException
-
getMetadataSafeStatement
public Statement getMetadataSafeStatement() throws SQLException
- 指定者:
getMetadataSafeStatement在接口中JdbcConnection- 抛出:
SQLException
-
getProperties
public Properties getProperties()
从接口复制的说明:MysqlConnectionReturns the parsed and passed in properties for this connection.- 指定者:
getProperties在接口中MysqlConnection- 返回:
Properties
-
getServerVersion
public ServerVersion getServerVersion()
- 指定者:
getServerVersion在接口中JdbcConnection
-
getSession
public Session getSession()
- 指定者:
getSession在接口中MysqlConnection
-
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.
-
getQueryInterceptorsInstances
public List<QueryInterceptor> getQueryInterceptorsInstances()
- 指定者:
getQueryInterceptorsInstances在接口中JdbcConnection
-
getTransactionIsolation
public int getTransactionIsolation() throws SQLException- 指定者:
getTransactionIsolation在接口中Connection- 抛出:
SQLException
-
getTypeMap
public Map<String,Class<?>> getTypeMap() throws SQLException
- 指定者:
getTypeMap在接口中Connection- 抛出:
SQLException
-
getURL
public String getURL()
- 指定者:
getURL在接口中MysqlConnection
-
getUser
public String getUser()
- 指定者:
getUser在接口中MysqlConnection
-
getWarnings
public SQLWarning getWarnings() throws SQLException
- 指定者:
getWarnings在接口中Connection- 抛出:
SQLException
-
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
-
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
-
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
-
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
-
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.
-
isReadOnly
public boolean isReadOnly() throws SQLException- 指定者:
isReadOnly在接口中Connection- 抛出:
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
-
isSameResource
public boolean isSameResource(JdbcConnection otherConnection)
从接口复制的说明:JdbcConnectionDoes this connection have the same resource name as the given connection (for XA)?- 指定者:
isSameResource在接口中JdbcConnection- 参数:
otherConnection- connection- 返回:
- true if it is the same one
-
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'
-
nativeSQL
public String nativeSQL(String sql) throws SQLException
- 指定者:
nativeSQL在接口中Connection- 抛出:
SQLException
-
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
-
pingInternal
public void pingInternal(boolean checkForClosedConnection, int timeoutMillis) throws SQLException- 指定者:
pingInternal在接口中JdbcConnection- 抛出:
SQLException
-
prepareCall
public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) 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 sql) throws SQLException
- 指定者:
prepareCall在接口中Connection- 抛出:
SQLException
-
prepareStatement
public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) 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 sql, int autoGenKeyIndex) throws SQLException
- 指定者:
prepareStatement在接口中Connection- 抛出:
SQLException
-
prepareStatement
public PreparedStatement prepareStatement(String sql, int[] autoGenKeyIndexes) throws SQLException
- 指定者:
prepareStatement在接口中Connection- 抛出:
SQLException
-
prepareStatement
public PreparedStatement prepareStatement(String sql, String[] autoGenKeyColNames) throws SQLException
- 指定者:
prepareStatement在接口中Connection- 抛出:
SQLException
-
prepareStatement
public PreparedStatement prepareStatement(String sql) throws SQLException
- 指定者:
prepareStatement在接口中Connection- 抛出:
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
-
releaseSavepoint
public void releaseSavepoint(Savepoint arg0) throws SQLException
- 指定者:
releaseSavepoint在接口中Connection- 抛出:
SQLException
-
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.
-
rollback
public void rollback() throws SQLException- 指定者:
rollback在接口中Connection- 抛出:
SQLException
-
rollback
public void rollback(Savepoint savepoint) throws SQLException
- 指定者:
rollback在接口中Connection- 抛出:
SQLException
-
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 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 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[] 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[])
-
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)
-
setAutoCommit
public void setAutoCommit(boolean autoCommitFlag) throws SQLException- 指定者:
setAutoCommit在接口中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
-
setFailedOver
public void setFailedOver(boolean flag)
- 指定者:
setFailedOver在接口中JdbcConnection- 参数:
flag- The failedOver flag to set.
-
setHoldability
public void setHoldability(int arg0) throws SQLException- 指定者:
setHoldability在接口中Connection- 抛出:
SQLException
-
setInGlobalTx
public void setInGlobalTx(boolean flag)
从接口复制的说明:JdbcConnectionSet the state of being in a global (XA) transaction.- 指定者:
setInGlobalTx在接口中JdbcConnection- 参数:
flag- the state flag
-
setProxy
public void setProxy(JdbcConnection proxy)
- 指定者:
setProxy在接口中JdbcConnection
-
setReadOnly
public void setReadOnly(boolean readOnlyFlag) throws SQLException- 指定者:
setReadOnly在接口中Connection- 抛出:
SQLException
-
setReadOnlyInternal
public void setReadOnlyInternal(boolean readOnlyFlag) throws SQLException- 指定者:
setReadOnlyInternal在接口中JdbcConnection- 抛出:
SQLException
-
setSavepoint
public Savepoint setSavepoint() throws SQLException
- 指定者:
setSavepoint在接口中Connection- 抛出:
SQLException
-
setSavepoint
public Savepoint setSavepoint(String name) throws SQLException
- 指定者:
setSavepoint在接口中Connection- 抛出:
SQLException
-
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.
-
setTransactionIsolation
public void setTransactionIsolation(int level) throws SQLException- 指定者:
setTransactionIsolation在接口中Connection- 抛出:
SQLException
-
shutdownServer
public void shutdownServer() throws SQLException从接口复制的说明:JdbcConnectionUsed by MiniAdmin to shutdown a MySQL server- 指定者:
shutdownServer在接口中JdbcConnection- 抛出:
SQLException- if the command can not be issued.
-
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
-
isClosed
public boolean isClosed() throws SQLException- 指定者:
isClosed在接口中Connection- 抛出:
SQLException
-
isProxySet
public boolean isProxySet()
- 指定者:
isProxySet在接口中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
-
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.
-
createSQLXML
public SQLXML createSQLXML() throws SQLException
- 指定者:
createSQLXML在接口中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
-
getClientInfo
public Properties getClientInfo() throws SQLException
- 指定者:
getClientInfo在接口中Connection- 抛出:
SQLException
-
getClientInfo
public String getClientInfo(String name) throws SQLException
- 指定者:
getClientInfo在接口中Connection- 抛出:
SQLException
-
isValid
public boolean isValid(int timeout) throws SQLException- 指定者:
isValid在接口中Connection- 抛出:
SQLException
-
setClientInfo
public void setClientInfo(Properties properties) throws SQLClientInfoException
- 指定者:
setClientInfo在接口中Connection- 抛出:
SQLClientInfoException
-
setClientInfo
public void setClientInfo(String name, String value) throws SQLClientInfoException
- 指定者:
setClientInfo在接口中Connection- 抛出:
SQLClientInfoException
-
isWrapperFor
public boolean isWrapperFor(Class<?> iface) throws SQLException
- 指定者:
isWrapperFor在接口中Wrapper- 抛出:
SQLException
-
unwrap
public <T> T unwrap(Class<T> iface) throws SQLException
- 指定者:
unwrap在接口中Wrapper- 抛出:
SQLException
-
createBlob
public Blob createBlob() throws SQLException
- 指定者:
createBlob在接口中Connection- 抛出:
SQLException
-
createClob
public Clob createClob() throws SQLException
- 指定者:
createClob在接口中Connection- 抛出:
SQLException
-
createNClob
public NClob createNClob() throws SQLException
- 指定者:
createNClob在接口中Connection- 抛出:
SQLException
-
getClientInfoProviderImpl
public ClientInfoProvider getClientInfoProviderImpl() throws SQLException
- 指定者:
getClientInfoProviderImpl在接口中JdbcConnection- 抛出:
SQLException
-
getPropertySet
public JdbcPropertySet getPropertySet()
- 指定者:
getPropertySet在接口中JdbcConnection- 指定者:
getPropertySet在接口中MysqlConnection
-
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()
-
-