public class ConnectionImpl extends java.lang.Object implements JdbcConnection, Session.SessionEventListener, java.io.Serializable
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.
| Modifier and Type | Field and Description |
|---|---|
static java.util.Map<?,?> |
charsetMap
The mapping between MySQL charset names and Java charset names.
|
protected static java.lang.String |
DEFAULT_LOGGER_CLASS
Default logger class name
|
protected ResultSetFactory |
nullStatementResultSetFactory |
protected JdbcPropertySet |
propertySet |
protected java.util.Properties |
props
Properties for this connection specified by user
|
protected LRUCache<java.lang.String,CachedResultSetMetaData> |
resultSetMetadataCache
Cache of ResultSet metadata
|
protected static java.util.Map<?,?> |
roundRobinStatsMap |
| Modifier | Constructor and Description |
|---|---|
protected |
ConnectionImpl()
'
For the delegate only
|
|
ConnectionImpl(HostInfo hostInfo)
Creates a connection to a MySQL Server.
|
| Modifier and Type | Method and Description |
|---|---|
void |
abort(java.util.concurrent.Executor executor) |
void |
abortInternal()
Clobbers the physical network connection and marks this connection as closed.
|
void |
changeUser(java.lang.String userName,
java.lang.String newPassword)
Changes the user on this connection by performing a re-authentication.
|
void |
checkClosed() |
void |
cleanup(java.lang.Throwable whyCleanedUp)
Destroys this connection and any underlying resources.
|
void |
clearHasTriedMaster()
Deprecated.
|
void |
clearWarnings() |
java.sql.PreparedStatement |
clientPrepareStatement(java.lang.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.
|
java.sql.PreparedStatement |
clientPrepareStatement(java.lang.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.
|
java.sql.PreparedStatement |
clientPrepareStatement(java.lang.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.
|
java.sql.PreparedStatement |
clientPrepareStatement(java.lang.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.
|
java.sql.PreparedStatement |
clientPrepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
boolean processEscapeCodesIfNeeded) |
java.sql.PreparedStatement |
clientPrepareStatement(java.lang.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.
|
java.sql.PreparedStatement |
clientPrepareStatement(java.lang.String sql,
java.lang.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.
|
void |
close() |
void |
commit() |
java.sql.Array |
createArrayOf(java.lang.String typeName,
java.lang.Object[] elements) |
java.sql.Blob |
createBlob() |
java.sql.Clob |
createClob() |
java.sql.NClob |
createNClob() |
void |
createNewIO(boolean isForReconnect)
Creates an IO channel to the server.
|
java.sql.SQLXML |
createSQLXML() |
java.sql.Statement |
createStatement() |
java.sql.Statement |
createStatement(int resultSetType,
int resultSetConcurrency) |
java.sql.Statement |
createStatement(int resultSetType,
int resultSetConcurrency,
int resultSetHoldability) |
java.sql.Struct |
createStruct(java.lang.String typeName,
java.lang.Object[] attributes) |
void |
decachePreparedStatement(JdbcPreparedStatement pstmt) |
JdbcConnection |
getActiveMySQLConnection() |
int |
getActiveStatementCount()
Returns the number of statements active on this connection, which
haven't been .close()d.
|
boolean |
getAutoCommit() |
int |
getAutoIncrementIncrement()
Returns the -session- value of 'auto_increment_increment' from the server if it exists,
or '1' if not.
|
CachedResultSetMetaData |
getCachedMetaData(java.lang.String sql)
Returns cached metadata (or null if not cached) for the given query, which must match _exactly_.
|
java.lang.String |
getCatalog() |
java.lang.String |
getCharacterSetMetadata() |
java.util.Properties |
getClientInfo() |
java.lang.String |
getClientInfo(java.lang.String name) |
ClientInfoProvider |
getClientInfoProviderImpl() |
java.lang.Object |
getConnectionMutex() |
java.lang.String |
getDatabase()
Retrieves this connection object's current database name.
|
ExceptionInterceptor |
getExceptionInterceptor() |
int |
getHoldability() |
java.lang.String |
getHost() |
java.lang.String |
getHostPortPair() |
long |
getId() |
long |
getIdleFor()
NOT JDBC-Compliant, but clients can use this method to determine how long
this connection has been idle.
|
static JdbcConnection |
getInstance(HostInfo hostInfo)
Creates a connection instance.
|
java.sql.DatabaseMetaData |
getMetaData() |
java.sql.Statement |
getMetadataSafeStatement() |
java.sql.Statement |
getMetadataSafeStatement(int maxRows) |
JdbcConnection |
getMultiHostParentProxy() |
JdbcConnection |
getMultiHostSafeProxy() |
int |
getNetworkTimeout() |
protected static int |
getNextRoundRobinHostIndex(java.lang.String url,
java.util.List<?> hostList) |
java.util.Properties |
getProperties()
Returns the parsed and passed in properties for this connection.
|
JdbcPropertySet |
getPropertySet() |
java.util.List<QueryInterceptor> |
getQueryInterceptorsInstances() |
java.lang.String |
getSchema() |
ServerVersion |
getServerVersion() |
NativeSession |
getSession() |
int |
getSessionMaxRows()
Returns the sql select limit max-rows for this session.
|
java.lang.String |
getStatementComment()
Returns the comment that will be prepended to all statements
sent to the server.
|
int |
getTransactionIsolation() |
java.util.Map<java.lang.String,java.lang.Class<?>> |
getTypeMap() |
java.lang.String |
getURL() |
java.lang.String |
getUser() |
java.sql.SQLWarning |
getWarnings() |
void |
handleCleanup(java.lang.Throwable whyCleanedUp) |
void |
handleNormalClose() |
void |
handleReconnect() |
boolean |
hasSameProperties(JdbcConnection c)
Does this connection have the same properties as another?
|
boolean |
hasTriedMaster()
Deprecated.
|
void |
initializeResultsMetadataFromCache(java.lang.String sql,
CachedResultSetMetaData cachedMetaData,
ResultSetInternalMethods resultSet)
Caches CachedResultSetMetaData that has been placed in the cache using the given SQL as a key.
|
void |
initializeSafeQueryInterceptors() |
boolean |
isClosed() |
boolean |
isInGlobalTx()
Is this connection currently a participant in an XA transaction?
|
boolean |
isProxySet() |
boolean |
isReadOnly() |
boolean |
isReadOnly(boolean useSessionStatus)
Tests to see if the connection is in Read Only Mode.
|
boolean |
isSameResource(JdbcConnection otherConnection)
Does this connection have the same resource name as the given
connection (for XA)?
|
boolean |
isServerLocal()
Is the server this connection is connected to "local" (i.e.
|
boolean |
isSourceConnection()
Is this connection connected to the first host in the list if
there is a list of servers in the URL?
|
boolean |
isValid(int timeout) |
boolean |
isWrapperFor(java.lang.Class<?> iface) |
boolean |
lowerCaseTableNames()
Is the server configured to use lower-case table names only?
|
java.lang.String |
nativeSQL(java.lang.String sql) |
void |
normalClose() |
void |
ping()
Detect if the connection is still good by sending a ping command
to the server.
|
void |
pingInternal(boolean checkForClosedConnection,
int timeoutMillis) |
java.sql.CallableStatement |
prepareCall(java.lang.String sql) |
java.sql.CallableStatement |
prepareCall(java.lang.String sql,
int resultSetType,
int resultSetConcurrency) |
java.sql.CallableStatement |
prepareCall(java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability) |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql) |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int autoGenKeyIndex) |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int[] autoGenKeyIndexes) |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency) |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability) |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
java.lang.String[] autoGenKeyColNames) |
void |
realClose(boolean calledExplicitly,
boolean issueRollback,
boolean skipLocalTeardown,
java.lang.Throwable reason)
Closes connection and frees resources.
|
void |
recachePreparedStatement(JdbcPreparedStatement pstmt) |
void |
registerStatement(JdbcStatement stmt)
Register a Statement instance as open.
|
void |
releaseSavepoint(java.sql.Savepoint arg0) |
void |
resetServerState()
Resets the server-side state of this connection.
|
void |
rollback() |
void |
rollback(java.sql.Savepoint savepoint) |
java.sql.PreparedStatement |
serverPrepareStatement(java.lang.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.
|
java.sql.PreparedStatement |
serverPrepareStatement(java.lang.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.
|
java.sql.PreparedStatement |
serverPrepareStatement(java.lang.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.
|
java.sql.PreparedStatement |
serverPrepareStatement(java.lang.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.
|
java.sql.PreparedStatement |
serverPrepareStatement(java.lang.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.
|
java.sql.PreparedStatement |
serverPrepareStatement(java.lang.String sql,
java.lang.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.
|
void |
setAutoCommit(boolean autoCommitFlag) |
void |
setCatalog(java.lang.String catalog) |
void |
setClientInfo(java.util.Properties properties) |
void |
setClientInfo(java.lang.String name,
java.lang.String value) |
void |
setDatabase(java.lang.String db)
Set current database for this connection.
|
void |
setFailedOver(boolean flag) |
void |
setHoldability(int arg0) |
void |
setInGlobalTx(boolean flag)
Set the state of being in a global (XA) transaction.
|
void |
setNetworkTimeout(java.util.concurrent.Executor executor,
int milliseconds) |
void |
setProxy(JdbcConnection proxy) |
void |
setReadOnly(boolean readOnlyFlag) |
void |
setReadOnlyInternal(boolean readOnlyFlag) |
java.sql.Savepoint |
setSavepoint() |
java.sql.Savepoint |
setSavepoint(java.lang.String name) |
void |
setSchema(java.lang.String schema) |
void |
setSessionMaxRows(int max)
Sets the sql select limit max-rows for this session if different from current.
|
void |
setStatementComment(java.lang.String comment)
Sets the comment that will be prepended to all statements
sent to the server.
|
void |
setTransactionIsolation(int level) |
void |
setTypeMap(java.util.Map<java.lang.String,java.lang.Class<?>> map) |
void |
shutdownServer()
Used by MiniAdmin to shutdown a MySQL server
|
boolean |
storesLowerCaseTableName() |
void |
throwConnectionClosedException() |
void |
transactionBegun() |
void |
transactionCompleted() |
void |
unregisterStatement(JdbcStatement stmt)
Remove the given statement from the list of open statements
|
void |
unSafeQueryInterceptors() |
<T> T |
unwrap(java.lang.Class<T> iface) |
boolean |
versionMeetsMinimum(int major,
int minor,
int subminor) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisMasterConnectionpublic static java.util.Map<?,?> charsetMap
protected static final java.lang.String DEFAULT_LOGGER_CLASS
protected static java.util.Map<?,?> roundRobinStatsMap
protected java.util.Properties props
protected LRUCache<java.lang.String,CachedResultSetMetaData> resultSetMetadataCache
protected JdbcPropertySet propertySet
protected ResultSetFactory nullStatementResultSetFactory
protected ConnectionImpl()
public ConnectionImpl(HostInfo hostInfo) throws java.sql.SQLException
hostInfo - the HostInfo instance that contains the host, user and connections attributes for this connectionjava.sql.SQLException - if a database access error occurspublic java.lang.String getHost()
getHost in interface JdbcConnectionpublic boolean isProxySet()
isProxySet in interface JdbcConnectionpublic void setProxy(JdbcConnection proxy)
setProxy in interface JdbcConnectionpublic JdbcConnection getMultiHostSafeProxy()
getMultiHostSafeProxy in interface JdbcConnectionpublic JdbcConnection getMultiHostParentProxy()
getMultiHostParentProxy in interface JdbcConnectionpublic JdbcConnection getActiveMySQLConnection()
getActiveMySQLConnection in interface JdbcConnectionpublic java.lang.Object getConnectionMutex()
getConnectionMutex in interface MysqlConnectionpublic static JdbcConnection getInstance(HostInfo hostInfo) throws java.sql.SQLException
hostInfo - HostInfo instanceConnectionImpl instancejava.sql.SQLException - if a database access error occursprotected static int getNextRoundRobinHostIndex(java.lang.String url,
java.util.List<?> hostList)
url - connection URLhostList - hosts listpublic JdbcPropertySet getPropertySet()
getPropertySet in interface JdbcConnectiongetPropertySet in interface MysqlConnectionpublic void unSafeQueryInterceptors()
throws java.sql.SQLException
unSafeQueryInterceptors in interface JdbcConnectionjava.sql.SQLExceptionpublic void initializeSafeQueryInterceptors()
throws java.sql.SQLException
initializeSafeQueryInterceptors in interface JdbcConnectionjava.sql.SQLExceptionpublic java.util.List<QueryInterceptor> getQueryInterceptorsInstances()
getQueryInterceptorsInstances in interface JdbcConnectionpublic void changeUser(java.lang.String userName,
java.lang.String newPassword)
throws java.sql.SQLException
JdbcConnectionchangeUser in interface JdbcConnectionuserName - the username to authenticate withnewPassword - the password to authenticate withjava.sql.SQLException - if authentication fails, or some other error occurs while
performing the command.public void checkClosed()
checkClosed in interface MysqlConnectionpublic void throwConnectionClosedException()
throws java.sql.SQLException
throwConnectionClosedException in interface JdbcConnectionjava.sql.SQLExceptionpublic void abortInternal()
throws java.sql.SQLException
JdbcConnectionabortInternal in interface JdbcConnectionjava.sql.SQLException - if an error occurspublic void cleanup(java.lang.Throwable whyCleanedUp)
MysqlConnectioncleanup in interface MysqlConnectionwhyCleanedUp - exception caused the connection clean up@Deprecated public void clearHasTriedMaster()
clearHasTriedMaster in interface JdbcConnectionpublic void clearWarnings()
throws java.sql.SQLException
clearWarnings in interface java.sql.Connectionjava.sql.SQLExceptionpublic java.sql.PreparedStatement clientPrepareStatement(java.lang.String sql)
throws java.sql.SQLException
JdbcConnectionclientPrepareStatement in interface JdbcConnectionsql - statementjava.sql.SQLException - if an error occursConnection.prepareStatement(String)public java.sql.PreparedStatement clientPrepareStatement(java.lang.String sql,
int autoGenKeyIndex)
throws java.sql.SQLException
JdbcConnectionclientPrepareStatement in interface JdbcConnectionsql - statementautoGenKeyIndex - autoGenKeyIndexjava.sql.SQLException - if an error occursConnection.prepareStatement(String, int)public java.sql.PreparedStatement clientPrepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency)
throws java.sql.SQLException
JdbcConnectionclientPrepareStatement in interface JdbcConnectionsql - statementresultSetType - resultSetTyperesultSetConcurrency - resultSetConcurrencyjava.sql.SQLException - if an error occursConnection.prepareStatement(String, int, int)public java.sql.PreparedStatement clientPrepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
boolean processEscapeCodesIfNeeded)
throws java.sql.SQLException
java.sql.SQLExceptionpublic java.sql.PreparedStatement clientPrepareStatement(java.lang.String sql,
int[] autoGenKeyIndexes)
throws java.sql.SQLException
JdbcConnectionclientPrepareStatement in interface JdbcConnectionsql - statementautoGenKeyIndexes - autoGenKeyIndexesjava.sql.SQLException - if an error occursConnection.prepareStatement(String, int[])public java.sql.PreparedStatement clientPrepareStatement(java.lang.String sql,
java.lang.String[] autoGenKeyColNames)
throws java.sql.SQLException
JdbcConnectionclientPrepareStatement in interface JdbcConnectionsql - statementautoGenKeyColNames - autoGenKeyColNamesjava.sql.SQLException - if an error occursConnection.prepareStatement(String, String[])public java.sql.PreparedStatement clientPrepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
throws java.sql.SQLException
JdbcConnectionclientPrepareStatement in interface JdbcConnectionsql - statementresultSetType - resultSetTyperesultSetConcurrency - resultSetConcurrencyresultSetHoldability - resultSetHoldabilityjava.sql.SQLException - if an error occursConnection.prepareStatement(String, int, int, int)public void close()
throws java.sql.SQLException
close in interface java.lang.AutoCloseableclose in interface java.sql.Connectionjava.sql.SQLExceptionpublic void normalClose()
normalClose in interface MysqlConnectionpublic void commit()
throws java.sql.SQLException
commit in interface java.sql.Connectionjava.sql.SQLExceptionpublic void createNewIO(boolean isForReconnect)
MysqlConnectioncreateNewIO in interface MysqlConnectionisForReconnect - is this request for a re-connectpublic java.sql.Statement createStatement()
throws java.sql.SQLException
createStatement in interface java.sql.Connectionjava.sql.SQLExceptionpublic java.sql.Statement createStatement(int resultSetType,
int resultSetConcurrency)
throws java.sql.SQLException
createStatement in interface java.sql.Connectionjava.sql.SQLExceptionpublic java.sql.Statement createStatement(int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
throws java.sql.SQLException
createStatement in interface java.sql.Connectionjava.sql.SQLExceptionpublic int getActiveStatementCount()
JdbcConnectiongetActiveStatementCount in interface JdbcConnectionpublic boolean getAutoCommit()
throws java.sql.SQLException
getAutoCommit in interface java.sql.Connectionjava.sql.SQLExceptionpublic java.lang.String getCatalog()
throws java.sql.SQLException
getCatalog in interface java.sql.Connectionjava.sql.SQLExceptionpublic java.lang.String getCharacterSetMetadata()
getCharacterSetMetadata in interface JdbcConnectionpublic int getHoldability()
throws java.sql.SQLException
getHoldability in interface java.sql.Connectionjava.sql.SQLExceptionpublic long getId()
getId in interface MysqlConnectionpublic long getIdleFor()
getIdleFor in interface JdbcConnectionpublic java.sql.DatabaseMetaData getMetaData()
throws java.sql.SQLException
getMetaData in interface java.sql.Connectionjava.sql.SQLExceptionpublic java.sql.Statement getMetadataSafeStatement()
throws java.sql.SQLException
getMetadataSafeStatement in interface JdbcConnectionjava.sql.SQLExceptionpublic java.sql.Statement getMetadataSafeStatement(int maxRows)
throws java.sql.SQLException
java.sql.SQLExceptionpublic ServerVersion getServerVersion()
getServerVersion in interface JdbcConnectionpublic int getTransactionIsolation()
throws java.sql.SQLException
getTransactionIsolation in interface java.sql.Connectionjava.sql.SQLExceptionpublic java.util.Map<java.lang.String,java.lang.Class<?>> getTypeMap()
throws java.sql.SQLException
getTypeMap in interface java.sql.Connectionjava.sql.SQLExceptionpublic java.lang.String getURL()
getURL in interface MysqlConnectionpublic java.lang.String getUser()
getUser in interface MysqlConnectionpublic java.sql.SQLWarning getWarnings()
throws java.sql.SQLException
getWarnings in interface java.sql.Connectionjava.sql.SQLExceptionpublic boolean hasSameProperties(JdbcConnection c)
JdbcConnectionhasSameProperties in interface JdbcConnectionc - connectionpublic java.util.Properties getProperties()
MysqlConnectiongetProperties in interface MysqlConnectionProperties@Deprecated public boolean hasTriedMaster()
JdbcConnectionhasTriedMaster in interface JdbcConnectionpublic boolean isClosed()
isClosed in interface java.sql.Connectionpublic boolean isInGlobalTx()
JdbcConnectionisInGlobalTx in interface JdbcConnectionpublic boolean isSourceConnection()
JdbcConnectionisSourceConnection in interface JdbcConnectionpublic boolean isReadOnly()
throws java.sql.SQLException
isReadOnly in interface java.sql.Connectionjava.sql.SQLExceptionpublic boolean isReadOnly(boolean useSessionStatus)
throws java.sql.SQLException
JdbcConnectionisReadOnly in interface JdbcConnectionuseSessionStatus - 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 casejava.sql.SQLException - if a database access error occurspublic boolean isSameResource(JdbcConnection otherConnection)
JdbcConnectionisSameResource in interface JdbcConnectionotherConnection - connectionpublic int getAutoIncrementIncrement()
JdbcConnectiongetAutoIncrementIncrement in interface JdbcConnectionpublic boolean lowerCaseTableNames()
JdbcConnectionlowerCaseTableNames in interface JdbcConnectionpublic java.lang.String nativeSQL(java.lang.String sql)
throws java.sql.SQLException
nativeSQL in interface java.sql.Connectionjava.sql.SQLExceptionpublic void ping()
throws java.sql.SQLException
JdbcConnectionping in interface JdbcConnectionjava.sql.SQLException - if the ping failspublic void pingInternal(boolean checkForClosedConnection,
int timeoutMillis)
throws java.sql.SQLException
pingInternal in interface JdbcConnectionjava.sql.SQLExceptionpublic java.sql.CallableStatement prepareCall(java.lang.String sql)
throws java.sql.SQLException
prepareCall in interface java.sql.Connectionjava.sql.SQLExceptionpublic java.sql.CallableStatement prepareCall(java.lang.String sql,
int resultSetType,
int resultSetConcurrency)
throws java.sql.SQLException
prepareCall in interface java.sql.Connectionjava.sql.SQLExceptionpublic java.sql.CallableStatement prepareCall(java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
throws java.sql.SQLException
prepareCall in interface java.sql.Connectionjava.sql.SQLExceptionpublic java.sql.PreparedStatement prepareStatement(java.lang.String sql)
throws java.sql.SQLException
prepareStatement in interface java.sql.Connectionjava.sql.SQLExceptionpublic java.sql.PreparedStatement prepareStatement(java.lang.String sql,
int autoGenKeyIndex)
throws java.sql.SQLException
prepareStatement in interface java.sql.Connectionjava.sql.SQLExceptionpublic java.sql.PreparedStatement prepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency)
throws java.sql.SQLException
prepareStatement in interface java.sql.Connectionjava.sql.SQLExceptionpublic java.sql.PreparedStatement prepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
throws java.sql.SQLException
prepareStatement in interface java.sql.Connectionjava.sql.SQLExceptionpublic java.sql.PreparedStatement prepareStatement(java.lang.String sql,
int[] autoGenKeyIndexes)
throws java.sql.SQLException
prepareStatement in interface java.sql.Connectionjava.sql.SQLExceptionpublic java.sql.PreparedStatement prepareStatement(java.lang.String sql,
java.lang.String[] autoGenKeyColNames)
throws java.sql.SQLException
prepareStatement in interface java.sql.Connectionjava.sql.SQLExceptionpublic void realClose(boolean calledExplicitly,
boolean issueRollback,
boolean skipLocalTeardown,
java.lang.Throwable reason)
throws java.sql.SQLException
JdbcConnectionrealClose in interface JdbcConnectioncalledExplicitly - 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 calljava.sql.SQLException - if an error occurspublic void recachePreparedStatement(JdbcPreparedStatement pstmt) throws java.sql.SQLException
recachePreparedStatement in interface JdbcConnectionjava.sql.SQLExceptionpublic void decachePreparedStatement(JdbcPreparedStatement pstmt) throws java.sql.SQLException
decachePreparedStatement in interface JdbcConnectionjava.sql.SQLExceptionpublic void registerStatement(JdbcStatement stmt)
JdbcConnectionregisterStatement in interface JdbcConnectionstmt - the Statement instance to removepublic void releaseSavepoint(java.sql.Savepoint arg0)
throws java.sql.SQLException
releaseSavepoint in interface java.sql.Connectionjava.sql.SQLExceptionpublic void resetServerState()
throws java.sql.SQLException
JdbcConnectionresetServerState in interface JdbcConnectionjava.sql.SQLException - if the operation fails while resetting server state.public void rollback()
throws java.sql.SQLException
rollback in interface java.sql.Connectionjava.sql.SQLExceptionpublic void rollback(java.sql.Savepoint savepoint)
throws java.sql.SQLException
rollback in interface java.sql.Connectionjava.sql.SQLExceptionpublic java.sql.PreparedStatement serverPrepareStatement(java.lang.String sql)
throws java.sql.SQLException
JdbcConnectionserverPrepareStatement in interface JdbcConnectionsql - statementjava.sql.SQLException - if an error occursConnection.prepareStatement(String)public java.sql.PreparedStatement serverPrepareStatement(java.lang.String sql,
int autoGenKeyIndex)
throws java.sql.SQLException
JdbcConnectionserverPrepareStatement in interface JdbcConnectionsql - statementautoGenKeyIndex - autoGenKeyIndexjava.sql.SQLException - if an error occursConnection.prepareStatement(String, int)public java.sql.PreparedStatement serverPrepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency)
throws java.sql.SQLException
JdbcConnectionserverPrepareStatement in interface JdbcConnectionsql - statementresultSetType - resultSetTyperesultSetConcurrency - resultSetConcurrencyjava.sql.SQLException - if an error occursConnection.prepareStatement(String, int, int)public java.sql.PreparedStatement serverPrepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
throws java.sql.SQLException
JdbcConnectionserverPrepareStatement in interface JdbcConnectionsql - statementresultSetType - resultSetTyperesultSetConcurrency - resultSetConcurrencyresultSetHoldability - resultSetHoldabilityjava.sql.SQLException - if an error occursConnection.prepareStatement(String, int, int, int)public java.sql.PreparedStatement serverPrepareStatement(java.lang.String sql,
int[] autoGenKeyIndexes)
throws java.sql.SQLException
JdbcConnectionserverPrepareStatement in interface JdbcConnectionsql - statementautoGenKeyIndexes - autoGenKeyIndexesjava.sql.SQLException - if an error occursConnection.prepareStatement(String, int[])public java.sql.PreparedStatement serverPrepareStatement(java.lang.String sql,
java.lang.String[] autoGenKeyColNames)
throws java.sql.SQLException
JdbcConnectionserverPrepareStatement in interface JdbcConnectionsql - statementautoGenKeyColNames - autoGenKeyColNamesjava.sql.SQLException - if an error occursConnection.prepareStatement(String, String[])public void setAutoCommit(boolean autoCommitFlag)
throws java.sql.SQLException
setAutoCommit in interface java.sql.Connectionjava.sql.SQLExceptionpublic void setCatalog(java.lang.String catalog)
throws java.sql.SQLException
setCatalog in interface java.sql.Connectionjava.sql.SQLExceptionpublic void setDatabase(java.lang.String db)
throws java.sql.SQLException
JdbcConnectionsetDatabase in interface JdbcConnectiondb - the database for this connection to usejava.sql.SQLException - if a database access error occurspublic java.lang.String getDatabase()
throws java.sql.SQLException
JdbcConnectiongetDatabase in interface JdbcConnectionjava.sql.SQLException - if an error occurspublic void setFailedOver(boolean flag)
setFailedOver in interface JdbcConnectionflag - The failedOver flag to set.public void setHoldability(int arg0)
throws java.sql.SQLException
setHoldability in interface java.sql.Connectionjava.sql.SQLExceptionpublic void setInGlobalTx(boolean flag)
JdbcConnectionsetInGlobalTx in interface JdbcConnectionflag - the state flagpublic void setReadOnly(boolean readOnlyFlag)
throws java.sql.SQLException
setReadOnly in interface java.sql.Connectionjava.sql.SQLExceptionpublic void setReadOnlyInternal(boolean readOnlyFlag)
throws java.sql.SQLException
setReadOnlyInternal in interface JdbcConnectionjava.sql.SQLExceptionpublic java.sql.Savepoint setSavepoint()
throws java.sql.SQLException
setSavepoint in interface java.sql.Connectionjava.sql.SQLExceptionpublic java.sql.Savepoint setSavepoint(java.lang.String name)
throws java.sql.SQLException
setSavepoint in interface java.sql.Connectionjava.sql.SQLExceptionpublic void setTransactionIsolation(int level)
throws java.sql.SQLException
setTransactionIsolation in interface java.sql.Connectionjava.sql.SQLExceptionpublic void setTypeMap(java.util.Map<java.lang.String,java.lang.Class<?>> map)
throws java.sql.SQLException
setTypeMap in interface java.sql.Connectionjava.sql.SQLExceptionpublic void shutdownServer()
throws java.sql.SQLException
JdbcConnectionshutdownServer in interface JdbcConnectionjava.sql.SQLException - if the command can not be issued.public void unregisterStatement(JdbcStatement stmt)
JdbcConnectionunregisterStatement in interface JdbcConnectionstmt - the Statement instance to removepublic boolean versionMeetsMinimum(int major,
int minor,
int subminor)
public CachedResultSetMetaData getCachedMetaData(java.lang.String sql)
JdbcConnectiongetCachedMetaData in interface JdbcConnectionsql - the query that is the key to the cachepublic void initializeResultsMetadataFromCache(java.lang.String sql,
CachedResultSetMetaData cachedMetaData,
ResultSetInternalMethods resultSet)
throws java.sql.SQLException
JdbcConnectioninitializeResultsMetadataFromCache in interface JdbcConnectionsql - 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.java.sql.SQLException - if an error occurspublic java.lang.String getStatementComment()
JdbcConnectiongetStatementComment in interface JdbcConnectionpublic void setStatementComment(java.lang.String comment)
JdbcConnectionsetStatementComment in interface JdbcConnectioncomment - the comment that will be prepended to all statements
sent to the server.public void transactionBegun()
transactionBegun in interface TransactionEventHandlerpublic void transactionCompleted()
transactionCompleted in interface TransactionEventHandlerpublic boolean storesLowerCaseTableName()
storesLowerCaseTableName in interface JdbcConnectionpublic ExceptionInterceptor getExceptionInterceptor()
getExceptionInterceptor in interface MysqlConnectionpublic boolean isServerLocal()
throws java.sql.SQLException
JdbcConnectionisServerLocal in interface JdbcConnectionjava.sql.SQLException - if an error occurspublic int getSessionMaxRows()
JdbcConnectiongetSessionMaxRows in interface JdbcConnectionpublic void setSessionMaxRows(int max)
throws java.sql.SQLException
JdbcConnectionsetSessionMaxRows in interface JdbcConnectionmax - the new max-rows value to set.java.sql.SQLException - if a database error occurs issuing the statement that sets the limit.public void setSchema(java.lang.String schema)
throws java.sql.SQLException
setSchema in interface java.sql.Connectionjava.sql.SQLExceptionpublic java.lang.String getSchema()
throws java.sql.SQLException
getSchema in interface java.sql.Connectionjava.sql.SQLExceptionpublic void abort(java.util.concurrent.Executor executor)
throws java.sql.SQLException
abort in interface java.sql.Connectionjava.sql.SQLExceptionpublic void setNetworkTimeout(java.util.concurrent.Executor executor,
int milliseconds)
throws java.sql.SQLException
setNetworkTimeout in interface java.sql.Connectionjava.sql.SQLExceptionpublic int getNetworkTimeout()
throws java.sql.SQLException
getNetworkTimeout in interface java.sql.Connectionjava.sql.SQLExceptionpublic java.sql.Clob createClob()
createClob in interface java.sql.Connectionpublic java.sql.Blob createBlob()
createBlob in interface java.sql.Connectionpublic java.sql.NClob createNClob()
createNClob in interface java.sql.Connectionpublic java.sql.SQLXML createSQLXML()
throws java.sql.SQLException
createSQLXML in interface java.sql.Connectionjava.sql.SQLExceptionpublic boolean isValid(int timeout)
throws java.sql.SQLException
isValid in interface java.sql.Connectionjava.sql.SQLExceptionpublic ClientInfoProvider getClientInfoProviderImpl() throws java.sql.SQLException
getClientInfoProviderImpl in interface JdbcConnectionjava.sql.SQLExceptionpublic void setClientInfo(java.lang.String name,
java.lang.String value)
throws java.sql.SQLClientInfoException
setClientInfo in interface java.sql.Connectionjava.sql.SQLClientInfoExceptionpublic void setClientInfo(java.util.Properties properties)
throws java.sql.SQLClientInfoException
setClientInfo in interface java.sql.Connectionjava.sql.SQLClientInfoExceptionpublic java.lang.String getClientInfo(java.lang.String name)
throws java.sql.SQLException
getClientInfo in interface java.sql.Connectionjava.sql.SQLExceptionpublic java.util.Properties getClientInfo()
throws java.sql.SQLException
getClientInfo in interface java.sql.Connectionjava.sql.SQLExceptionpublic java.sql.Array createArrayOf(java.lang.String typeName,
java.lang.Object[] elements)
throws java.sql.SQLException
createArrayOf in interface java.sql.Connectionjava.sql.SQLExceptionpublic java.sql.Struct createStruct(java.lang.String typeName,
java.lang.Object[] attributes)
throws java.sql.SQLException
createStruct in interface java.sql.Connectionjava.sql.SQLExceptionpublic <T> T unwrap(java.lang.Class<T> iface)
throws java.sql.SQLException
unwrap in interface java.sql.Wrapperjava.sql.SQLExceptionpublic boolean isWrapperFor(java.lang.Class<?> iface)
throws java.sql.SQLException
isWrapperFor in interface java.sql.Wrapperjava.sql.SQLExceptionpublic NativeSession getSession()
getSession in interface MysqlConnectionpublic java.lang.String getHostPortPair()
getHostPortPair in interface JdbcConnectionpublic void handleNormalClose()
handleNormalClose in interface Session.SessionEventListenerpublic void handleReconnect()
handleReconnect in interface Session.SessionEventListenerpublic void handleCleanup(java.lang.Throwable whyCleanedUp)
handleCleanup in interface Session.SessionEventListener