类 ConnectionImpl
- java.lang.Object
-
- com.mysql.cj.jdbc.ConnectionImpl
-
- 所有已实现的接口:
JdbcConnection,MysqlConnection,Session.SessionEventListener,TransactionEventHandler,Serializable,AutoCloseable,Connection,Wrapper
public class ConnectionImpl extends Object implements JdbcConnection, Session.SessionEventListener, Serializable
A Connection represents a session with a specific database. Within the context of a Connection, SQL statements are executed and results are returned.A Connection's database is able to provide information describing its tables, its supported SQL grammar, its stored procedures, the capabilities of this connection, etc. This information is obtained with the getMetaData method.
- 另请参阅:
- 序列化表格
-
-
字段概要
字段 修饰符和类型 字段 说明 protected static StringDEFAULT_LOGGER_CLASSDefault logger class nameprotected ResultSetFactorynullStatementResultSetFactoryprotected JdbcPropertySetpropertySetprotected PropertiespropsProperties for this connection specified by userprotected LRUCache<String,CachedResultSetMetaData>resultSetMetadataCacheCache of ResultSet metadataprotected static Map<?,?>roundRobinStatsMap
-
构造器概要
构造器 限定符 构造器 说明 protectedConnectionImpl()' For the delegate onlyConnectionImpl(HostInfo hostInfo)Creates a connection to a MySQL Server.
-
方法概要
所有方法 静态方法 实例方法 具体方法 已过时的方法 修饰符和类型 方法 说明 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, boolean processEscapeCodesIfNeeded)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()NOT JDBC-Compliant, but clients can use this method to determine how long this connection has been idle.static JdbcConnectiongetInstance(HostInfo hostInfo)Creates a connection instance.DatabaseMetaDatagetMetaData()StatementgetMetadataSafeStatement()StatementgetMetadataSafeStatement(int maxRows)JdbcConnectiongetMultiHostParentProxy()JdbcConnectiongetMultiHostSafeProxy()intgetNetworkTimeout()protected static intgetNextRoundRobinHostIndex(String url, List<?> hostList)PropertiesgetProperties()Returns the parsed and passed in properties for this connection.JdbcPropertySetgetPropertySet()List<QueryInterceptor>getQueryInterceptorsInstances()StringgetSchema()ServerSessionStateControllergetServerSessionStateController()ServerVersiongetServerVersion()NativeSessiongetSession()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()voidhandleCleanup(Throwable whyCleanedUp)voidhandleNormalClose()voidhandleReconnect()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 db)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)booleanversionMeetsMinimum(int major, int minor, int subminor)-
从类继承的方法 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
-
-
-
-
字段详细资料
-
DEFAULT_LOGGER_CLASS
protected static final String DEFAULT_LOGGER_CLASS
Default logger class name
-
roundRobinStatsMap
protected static Map<?,?> roundRobinStatsMap
-
props
protected Properties props
Properties for this connection specified by user
-
resultSetMetadataCache
protected LRUCache<String,CachedResultSetMetaData> resultSetMetadataCache
Cache of ResultSet metadata
-
propertySet
protected JdbcPropertySet propertySet
-
nullStatementResultSetFactory
protected ResultSetFactory nullStatementResultSetFactory
-
-
构造器详细资料
-
ConnectionImpl
protected ConnectionImpl()
' For the delegate only
-
ConnectionImpl
public ConnectionImpl(HostInfo hostInfo) throws SQLException
Creates a connection to a MySQL Server.- 参数:
hostInfo- theHostInfoinstance that contains the host, user and connections attributes for this connection- 抛出:
SQLException- if a database access error occurs
-
-
方法详细资料
-
getHost
public String getHost()
- 指定者:
getHost在接口中JdbcConnection
-
isProxySet
public boolean isProxySet()
- 指定者:
isProxySet在接口中JdbcConnection
-
setProxy
public void setProxy(JdbcConnection proxy)
- 指定者:
setProxy在接口中JdbcConnection
-
getMultiHostSafeProxy
public JdbcConnection getMultiHostSafeProxy()
- 指定者:
getMultiHostSafeProxy在接口中JdbcConnection
-
getMultiHostParentProxy
public JdbcConnection getMultiHostParentProxy()
- 指定者:
getMultiHostParentProxy在接口中JdbcConnection
-
getActiveMySQLConnection
public JdbcConnection getActiveMySQLConnection()
- 指定者:
getActiveMySQLConnection在接口中JdbcConnection
-
getConnectionMutex
public Object getConnectionMutex()
- 指定者:
getConnectionMutex在接口中MysqlConnection
-
getInstance
public static JdbcConnection getInstance(HostInfo hostInfo) throws SQLException
Creates a connection instance.- 参数:
hostInfo-HostInfoinstance- 返回:
- new
ConnectionImplinstance - 抛出:
SQLException- if a database access error occurs
-
getNextRoundRobinHostIndex
protected static int getNextRoundRobinHostIndex(String url, List<?> hostList)
- 参数:
url- connection URLhostList- hosts list- 返回:
- index in a host list
-
getPropertySet
public JdbcPropertySet getPropertySet()
- 指定者:
getPropertySet在接口中JdbcConnection- 指定者:
getPropertySet在接口中MysqlConnection
-
unSafeQueryInterceptors
public void unSafeQueryInterceptors() throws SQLException- 指定者:
unSafeQueryInterceptors在接口中JdbcConnection- 抛出:
SQLException
-
initializeSafeQueryInterceptors
public void initializeSafeQueryInterceptors() throws SQLException- 指定者:
initializeSafeQueryInterceptors在接口中JdbcConnection- 抛出:
SQLException
-
getQueryInterceptorsInstances
public List<QueryInterceptor> getQueryInterceptorsInstances()
- 指定者:
getQueryInterceptorsInstances在接口中JdbcConnection
-
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
-
throwConnectionClosedException
public void throwConnectionClosedException() throws SQLException- 指定者:
throwConnectionClosedException在接口中JdbcConnection- 抛出:
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
-
cleanup
public void cleanup(Throwable whyCleanedUp)
从接口复制的说明:MysqlConnectionDestroys this connection and any underlying resources.- 指定者:
cleanup在接口中MysqlConnection- 参数:
whyCleanedUp- exception caused the connection clean up
-
clearHasTriedMaster
@Deprecated public void clearHasTriedMaster()
已过时。- 指定者:
clearHasTriedMaster在接口中JdbcConnection
-
clearWarnings
public void clearWarnings() throws SQLException- 指定者:
clearWarnings在接口中Connection- 抛出:
SQLException
-
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, boolean processEscapeCodesIfNeeded) throws SQLException
- 抛出:
SQLException
-
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, 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)
-
close
public void close() throws SQLException- 指定者:
close在接口中AutoCloseable- 指定者:
close在接口中Connection- 抛出:
SQLException
-
normalClose
public void normalClose()
- 指定者:
normalClose在接口中MysqlConnection
-
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) throws SQLException
- 指定者:
createStatement在接口中Connection- 抛出:
SQLException
-
createStatement
public Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) 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
-
getCatalog
public String getCatalog() throws SQLException
- 指定者:
getCatalog在接口中Connection- 抛出:
SQLException
-
getCharacterSetMetadata
public String getCharacterSetMetadata()
- 指定者:
getCharacterSetMetadata在接口中JdbcConnection- 返回:
- Returns the characterSetMetadata.
-
getHoldability
public int getHoldability() throws SQLException- 指定者:
getHoldability在接口中Connection- 抛出:
SQLException
-
getId
public long getId()
- 指定者:
getId在接口中MysqlConnection
-
getIdleFor
public long getIdleFor()
NOT JDBC-Compliant, but clients can use this method to determine 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
-
getMetadataSafeStatement
public Statement getMetadataSafeStatement() throws SQLException
- 指定者:
getMetadataSafeStatement在接口中JdbcConnection- 抛出:
SQLException
-
getMetadataSafeStatement
public Statement getMetadataSafeStatement(int maxRows) throws SQLException
- 抛出:
SQLException
-
getServerVersion
public ServerVersion getServerVersion()
- 指定者:
getServerVersion在接口中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
-
getProperties
public Properties getProperties()
从接口复制的说明:MysqlConnectionReturns the parsed and passed in properties for this connection.- 指定者:
getProperties在接口中MysqlConnection- 返回:
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
-
isClosed
public boolean isClosed()
- 指定者:
isClosed在接口中Connection
-
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
-
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'
-
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) 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, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
- 指定者:
prepareCall在接口中Connection- 抛出:
SQLException
-
prepareStatement
public PreparedStatement prepareStatement(String sql) 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 resultSetType, int resultSetConcurrency) throws SQLException
- 指定者:
prepareStatement在接口中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[] autoGenKeyIndexes) throws SQLException
- 指定者:
prepareStatement在接口中Connection- 抛出:
SQLException
-
prepareStatement
public PreparedStatement prepareStatement(String sql, String[] autoGenKeyColNames) 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) 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[])
-
setAutoCommit
public void setAutoCommit(boolean autoCommitFlag) throws SQLException- 指定者:
setAutoCommit在接口中Connection- 抛出:
SQLException
-
setCatalog
public void setCatalog(String catalog) throws SQLException
- 指定者:
setCatalog在接口中Connection- 抛出:
SQLException
-
setDatabase
public void setDatabase(String db) throws SQLException
从接口复制的说明:JdbcConnectionSet current database for this connection.- 指定者:
setDatabase在接口中JdbcConnection- 参数:
db- 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
-
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
-
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
-
setTransactionIsolation
public void setTransactionIsolation(int level) throws SQLException- 指定者:
setTransactionIsolation在接口中Connection- 抛出:
SQLException
-
setTypeMap
public void setTypeMap(Map<String,Class<?>> map) throws SQLException
- 指定者:
setTypeMap在接口中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.
-
unregisterStatement
public void unregisterStatement(JdbcStatement stmt)
从接口复制的说明:JdbcConnectionRemove the given statement from the list of open statements- 指定者:
unregisterStatement在接口中JdbcConnection- 参数:
stmt- the Statement instance to remove
-
versionMeetsMinimum
public boolean versionMeetsMinimum(int major, int minor, int subminor)
-
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.
-
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
-
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.
-
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.
-
transactionBegun
public void transactionBegun()
- 指定者:
transactionBegun在接口中TransactionEventHandler
-
transactionCompleted
public void transactionCompleted()
- 指定者:
transactionCompleted在接口中TransactionEventHandler
-
storesLowerCaseTableName
public boolean storesLowerCaseTableName()
- 指定者:
storesLowerCaseTableName在接口中JdbcConnection
-
getExceptionInterceptor
public ExceptionInterceptor getExceptionInterceptor()
- 指定者:
getExceptionInterceptor在接口中MysqlConnection
-
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
-
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.
-
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
-
createClob
public Clob createClob()
- 指定者:
createClob在接口中Connection
-
createBlob
public Blob createBlob()
- 指定者:
createBlob在接口中Connection
-
createNClob
public NClob createNClob()
- 指定者:
createNClob在接口中Connection
-
createSQLXML
public SQLXML createSQLXML() throws SQLException
- 指定者:
createSQLXML在接口中Connection- 抛出:
SQLException
-
isValid
public boolean isValid(int timeout) throws SQLException- 指定者:
isValid在接口中Connection- 抛出:
SQLException
-
getClientInfoProviderImpl
public ClientInfoProvider getClientInfoProviderImpl() throws SQLException
- 指定者:
getClientInfoProviderImpl在接口中JdbcConnection- 抛出:
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 NativeSession getSession()
- 指定者:
getSession在接口中MysqlConnection
-
getHostPortPair
public String getHostPortPair()
- 指定者:
getHostPortPair在接口中JdbcConnection
-
handleNormalClose
public void handleNormalClose()
-
handleReconnect
public void handleReconnect()
- 指定者:
handleReconnect在接口中Session.SessionEventListener
-
handleCleanup
public void handleCleanup(Throwable whyCleanedUp)
- 指定者:
handleCleanup在接口中Session.SessionEventListener
-
getServerSessionStateController
public ServerSessionStateController getServerSessionStateController()
-
-