public class ConnectionWrapper extends java.lang.Object implements JdbcConnection
| Modifier and Type | Field and Description |
|---|---|
protected ExceptionInterceptor |
exceptionInterceptor |
protected JdbcConnection |
mc |
protected MysqlPooledConnection |
pooledConnection |
protected java.util.Map<java.lang.Class<?>,java.lang.Object> |
unwrappedInterfaces |
| Constructor and Description |
|---|
ConnectionWrapper(MysqlPooledConnection mysqlPooledConnection,
JdbcConnection mysqlConnection,
boolean forXa)
Construct a new LogicalHandle and set instance variables
|
| 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.
|
protected void |
checkAndFireConnectionError(java.sql.SQLException sqlEx)
Fires connection error event if required, before re-throwing exception
|
void |
checkClosed() |
void |
cleanup(java.lang.Throwable whyCleanedUp)
Destroys this connection and any underlying resources.
|
void |
clearHasTriedMaster()
Deprecated.
|
void |
clearWarnings() |
java.sql.PreparedStatement |
clientPrepare(java.lang.String sql) |
java.sql.PreparedStatement |
clientPrepare(java.lang.String sql,
int resultSetType,
int resultSetConcurrency) |
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,
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()
The physical connection is not actually closed.
|
protected void |
close(boolean fireClosedEvent) |
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 arg0,
int arg1,
int arg2) |
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()
Reports how long this connection has been idle.
|
protected static ConnectionWrapper |
getInstance(MysqlPooledConnection mysqlPooledConnection,
JdbcConnection mysqlConnection,
boolean forXa) |
java.sql.DatabaseMetaData |
getMetaData() |
java.sql.Statement |
getMetadataSafeStatement() |
JdbcConnection |
getMultiHostParentProxy() |
JdbcConnection |
getMultiHostSafeProxy() |
int |
getNetworkTimeout() |
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() |
Session |
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() |
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 c)
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 arg0,
int arg1,
int arg2,
int arg3) |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql) |
java.sql.PreparedStatement |
prepareStatement(java.lang.String arg0,
int arg1) |
java.sql.PreparedStatement |
prepareStatement(java.lang.String arg0,
int[] arg1) |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency) |
java.sql.PreparedStatement |
prepareStatement(java.lang.String arg0,
int arg1,
int arg2,
int arg3) |
java.sql.PreparedStatement |
prepareStatement(java.lang.String arg0,
java.lang.String[] arg1) |
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 arg0) |
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 autoCommit) |
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 dbName)
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 conn) |
void |
setReadOnly(boolean readOnly) |
void |
setReadOnlyInternal(boolean readOnlyFlag) |
java.sql.Savepoint |
setSavepoint() |
java.sql.Savepoint |
setSavepoint(java.lang.String arg0) |
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) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisMasterConnectionprotected JdbcConnection mc
protected MysqlPooledConnection pooledConnection
protected java.util.Map<java.lang.Class<?>,java.lang.Object> unwrappedInterfaces
protected ExceptionInterceptor exceptionInterceptor
public ConnectionWrapper(MysqlPooledConnection mysqlPooledConnection, JdbcConnection mysqlConnection, boolean forXa) throws java.sql.SQLException
mysqlPooledConnection - reference to object that instantiated this objectmysqlConnection - physical connection to dbforXa - is it for XA connection?java.sql.SQLException - if an error occurs.protected static ConnectionWrapper getInstance(MysqlPooledConnection mysqlPooledConnection, JdbcConnection mysqlConnection, boolean forXa) throws java.sql.SQLException
java.sql.SQLExceptionpublic void setAutoCommit(boolean autoCommit)
throws java.sql.SQLException
setAutoCommit in interface java.sql.Connectionjava.sql.SQLExceptionpublic boolean getAutoCommit()
throws java.sql.SQLException
getAutoCommit in interface java.sql.Connectionjava.sql.SQLExceptionpublic void setDatabase(java.lang.String dbName)
throws java.sql.SQLException
JdbcConnectionsetDatabase in interface JdbcConnectiondbName - 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 setCatalog(java.lang.String catalog)
throws java.sql.SQLException
setCatalog in interface java.sql.Connectionjava.sql.SQLExceptionpublic java.lang.String getCatalog()
throws java.sql.SQLException
getCatalog in interface java.sql.Connectionjava.sql.SQLExceptionpublic boolean isClosed()
throws java.sql.SQLException
isClosed in interface java.sql.Connectionjava.sql.SQLExceptionpublic boolean isSourceConnection()
JdbcConnectionisSourceConnection in interface JdbcConnectionpublic void setHoldability(int arg0)
throws java.sql.SQLException
setHoldability in interface java.sql.Connectionjava.sql.SQLExceptionpublic int getHoldability()
throws java.sql.SQLException
getHoldability in interface java.sql.Connectionjava.sql.SQLExceptionpublic long getIdleFor()
JdbcConnectiongetIdleFor in interface JdbcConnectionpublic java.sql.DatabaseMetaData getMetaData()
throws java.sql.SQLException
getMetaData in interface java.sql.Connectionjava.sql.SQLExceptionpublic void setReadOnly(boolean readOnly)
throws java.sql.SQLException
setReadOnly in interface java.sql.Connectionjava.sql.SQLExceptionpublic boolean isReadOnly()
throws java.sql.SQLException
isReadOnly in interface java.sql.Connectionjava.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 arg0)
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 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.sql.SQLWarning getWarnings()
throws java.sql.SQLException
getWarnings in interface java.sql.Connectionjava.sql.SQLExceptionpublic void clearWarnings()
throws java.sql.SQLException
clearWarnings in interface java.sql.Connectionjava.sql.SQLExceptionpublic void close()
throws java.sql.SQLException
close in interface java.lang.AutoCloseableclose in interface java.sql.Connectionjava.sql.SQLException - if an error occurspublic void commit()
throws java.sql.SQLException
commit in interface java.sql.Connectionjava.sql.SQLExceptionpublic 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 arg0,
int arg1,
int arg2)
throws java.sql.SQLException
createStatement in interface java.sql.Connectionjava.sql.SQLExceptionpublic java.lang.String nativeSQL(java.lang.String sql)
throws java.sql.SQLException
nativeSQL in interface java.sql.Connectionjava.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 arg0,
int arg1,
int arg2,
int arg3)
throws java.sql.SQLException
prepareCall in interface java.sql.Connectionjava.sql.SQLExceptionpublic java.sql.PreparedStatement clientPrepare(java.lang.String sql)
throws java.sql.SQLException
java.sql.SQLExceptionpublic java.sql.PreparedStatement clientPrepare(java.lang.String sql,
int resultSetType,
int resultSetConcurrency)
throws java.sql.SQLException
java.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 resultSetType,
int resultSetConcurrency)
throws java.sql.SQLException
prepareStatement in interface java.sql.Connectionjava.sql.SQLExceptionpublic java.sql.PreparedStatement prepareStatement(java.lang.String arg0,
int arg1,
int arg2,
int arg3)
throws java.sql.SQLException
prepareStatement in interface java.sql.Connectionjava.sql.SQLExceptionpublic java.sql.PreparedStatement prepareStatement(java.lang.String arg0,
int arg1)
throws java.sql.SQLException
prepareStatement in interface java.sql.Connectionjava.sql.SQLExceptionpublic java.sql.PreparedStatement prepareStatement(java.lang.String arg0,
int[] arg1)
throws java.sql.SQLException
prepareStatement in interface java.sql.Connectionjava.sql.SQLExceptionpublic java.sql.PreparedStatement prepareStatement(java.lang.String arg0,
java.lang.String[] arg1)
throws java.sql.SQLException
prepareStatement in interface java.sql.Connectionjava.sql.SQLExceptionpublic void releaseSavepoint(java.sql.Savepoint arg0)
throws java.sql.SQLException
releaseSavepoint in interface java.sql.Connectionjava.sql.SQLExceptionpublic void rollback()
throws java.sql.SQLException
rollback in interface java.sql.Connectionjava.sql.SQLExceptionpublic void rollback(java.sql.Savepoint arg0)
throws java.sql.SQLException
rollback in interface java.sql.Connectionjava.sql.SQLExceptionpublic boolean isSameResource(JdbcConnection c)
JdbcConnectionisSameResource in interface JdbcConnectionc - connectionprotected void close(boolean fireClosedEvent)
throws java.sql.SQLException
java.sql.SQLExceptionpublic void checkClosed()
checkClosed in interface MysqlConnectionpublic boolean isInGlobalTx()
JdbcConnectionisInGlobalTx in interface JdbcConnectionpublic void setInGlobalTx(boolean flag)
JdbcConnectionsetInGlobalTx in interface JdbcConnectionflag - the state flagpublic void ping()
throws java.sql.SQLException
JdbcConnectionping in interface JdbcConnectionjava.sql.SQLException - if the ping failspublic 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.@Deprecated public void clearHasTriedMaster()
clearHasTriedMaster in interface JdbcConnectionpublic 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,
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 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 int getActiveStatementCount()
JdbcConnectiongetActiveStatementCount in interface JdbcConnectionpublic java.lang.String getStatementComment()
JdbcConnectiongetStatementComment in interface JdbcConnection@Deprecated public boolean hasTriedMaster()
JdbcConnectionhasTriedMaster in interface JdbcConnectionpublic boolean lowerCaseTableNames()
JdbcConnectionlowerCaseTableNames in interface JdbcConnectionpublic void resetServerState()
throws java.sql.SQLException
JdbcConnectionresetServerState in interface JdbcConnectionjava.sql.SQLException - if the operation fails while resetting server state.public 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 setFailedOver(boolean flag)
setFailedOver in interface JdbcConnectionflag - The failedOver flag to set.public 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 shutdownServer()
throws java.sql.SQLException
JdbcConnectionshutdownServer in interface JdbcConnectionjava.sql.SQLException - if the command can not be issued.public int getAutoIncrementIncrement()
JdbcConnectiongetAutoIncrementIncrement in interface JdbcConnectionpublic ExceptionInterceptor getExceptionInterceptor()
getExceptionInterceptor in interface MysqlConnectionpublic boolean hasSameProperties(JdbcConnection c)
JdbcConnectionhasSameProperties in interface JdbcConnectionc - connectionpublic java.util.Properties getProperties()
MysqlConnectiongetProperties in interface MysqlConnectionPropertiespublic java.lang.String getHost()
getHost in interface JdbcConnectionpublic void setProxy(JdbcConnection conn)
setProxy in interface JdbcConnectionpublic void setTypeMap(java.util.Map<java.lang.String,java.lang.Class<?>> map)
throws java.sql.SQLException
setTypeMap in interface java.sql.Connectionjava.sql.SQLExceptionpublic boolean isServerLocal()
throws java.sql.SQLException
JdbcConnectionisServerLocal in interface JdbcConnectionjava.sql.SQLException - if an error occurspublic 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 void abortInternal()
throws java.sql.SQLException
JdbcConnectionabortInternal in interface JdbcConnectionjava.sql.SQLException - if an error occurspublic java.lang.Object getConnectionMutex()
getConnectionMutex in interface MysqlConnectionpublic 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 java.sql.Clob createClob()
throws java.sql.SQLException
createClob in interface java.sql.Connectionjava.sql.SQLExceptionpublic java.sql.Blob createBlob()
throws java.sql.SQLException
createBlob in interface java.sql.Connectionjava.sql.SQLExceptionpublic java.sql.NClob createNClob()
throws java.sql.SQLException
createNClob in interface java.sql.Connectionjava.sql.SQLExceptionpublic 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 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 Session getSession()
getSession in interface MysqlConnectionpublic long getId()
getId in interface MysqlConnectionpublic java.lang.String getURL()
getURL in interface MysqlConnectionpublic java.lang.String getUser()
getUser in interface MysqlConnectionpublic void createNewIO(boolean isForReconnect)
MysqlConnectioncreateNewIO in interface MysqlConnectionisForReconnect - is this request for a re-connectpublic boolean isProxySet()
isProxySet in interface JdbcConnectionpublic JdbcPropertySet getPropertySet()
getPropertySet in interface JdbcConnectiongetPropertySet in interface MysqlConnectionpublic CachedResultSetMetaData getCachedMetaData(java.lang.String sql)
JdbcConnectiongetCachedMetaData in interface JdbcConnectionsql - the query that is the key to the cachepublic java.lang.String getCharacterSetMetadata()
getCharacterSetMetadata in interface JdbcConnectionpublic java.sql.Statement getMetadataSafeStatement()
throws java.sql.SQLException
getMetadataSafeStatement in interface JdbcConnectionjava.sql.SQLExceptionpublic ServerVersion getServerVersion()
getServerVersion in interface JdbcConnectionpublic java.util.List<QueryInterceptor> getQueryInterceptorsInstances()
getQueryInterceptorsInstances in interface JdbcConnectionpublic 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 void initializeSafeQueryInterceptors()
throws java.sql.SQLException
initializeSafeQueryInterceptors in interface JdbcConnectionjava.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 void pingInternal(boolean checkForClosedConnection,
int timeoutMillis)
throws java.sql.SQLException
pingInternal in interface JdbcConnectionjava.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 setReadOnlyInternal(boolean readOnlyFlag)
throws java.sql.SQLException
setReadOnlyInternal in interface JdbcConnectionjava.sql.SQLExceptionpublic boolean storesLowerCaseTableName()
storesLowerCaseTableName in interface JdbcConnectionpublic void throwConnectionClosedException()
throws java.sql.SQLException
throwConnectionClosedException in interface JdbcConnectionjava.sql.SQLExceptionpublic void transactionBegun()
transactionBegun in interface TransactionEventHandlerpublic void transactionCompleted()
transactionCompleted in interface TransactionEventHandlerpublic void unregisterStatement(JdbcStatement stmt)
JdbcConnectionunregisterStatement in interface JdbcConnectionstmt - the Statement instance to removepublic void unSafeQueryInterceptors()
throws java.sql.SQLException
unSafeQueryInterceptors in interface JdbcConnectionjava.sql.SQLExceptionpublic JdbcConnection getMultiHostSafeProxy()
getMultiHostSafeProxy in interface JdbcConnectionpublic JdbcConnection getMultiHostParentProxy()
getMultiHostParentProxy in interface JdbcConnectionpublic JdbcConnection getActiveMySQLConnection()
getActiveMySQLConnection in interface JdbcConnectionpublic ClientInfoProvider getClientInfoProviderImpl() throws java.sql.SQLException
getClientInfoProviderImpl in interface JdbcConnectionjava.sql.SQLExceptionpublic java.lang.String getHostPortPair()
getHostPortPair in interface JdbcConnectionpublic void normalClose()
normalClose in interface MysqlConnectionpublic void cleanup(java.lang.Throwable whyCleanedUp)
MysqlConnectioncleanup in interface MysqlConnectionwhyCleanedUp - exception caused the connection clean upprotected void checkAndFireConnectionError(java.sql.SQLException sqlEx)
throws java.sql.SQLException
sqlEx - the SQLException that has occurredjava.sql.SQLException - (rethrown)