private static class PoolingDriver.PoolGuardConnectionWrapper extends DelegatingConnection
AbandonedTrace.AbandonedObjectException
Modifier and Type | Field and Description |
---|---|
private java.sql.Connection |
delegate |
private org.apache.commons.pool.ObjectPool |
pool |
_closed, _conn
Constructor and Description |
---|
PoolGuardConnectionWrapper(org.apache.commons.pool.ObjectPool pool,
java.sql.Connection delegate) |
Modifier and Type | Method and Description |
---|---|
protected void |
checkOpen() |
void |
clearWarnings() |
void |
close()
Closes the underlying connection, and close
any Statements that were not explicitly closed.
|
void |
commit() |
java.sql.Statement |
createStatement() |
java.sql.Statement |
createStatement(int resultSetType,
int resultSetConcurrency) |
java.sql.Statement |
createStatement(int resultSetType,
int resultSetConcurrency,
int resultSetHoldability) |
boolean |
equals(java.lang.Object obj)
This method considers two objects to be equal
if the underlying jdbc objects are equal.
|
boolean |
getAutoCommit() |
java.lang.String |
getCatalog() |
java.sql.Connection |
getDelegate()
Returns my underlying
Connection . |
int |
getHoldability() |
java.sql.Connection |
getInnermostDelegate()
If my underlying
Connection is not a
DelegatingConnection, returns it,
otherwise recursively invokes this method on
my delegate. |
java.sql.DatabaseMetaData |
getMetaData() |
int |
getTransactionIsolation() |
java.util.Map |
getTypeMap() |
java.sql.SQLWarning |
getWarnings() |
int |
hashCode() |
boolean |
isClosed() |
boolean |
isReadOnly() |
java.lang.String |
nativeSQL(java.lang.String sql) |
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 autoGeneratedKeys) |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int[] columnIndexes) |
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[] columnNames) |
void |
releaseSavepoint(java.sql.Savepoint savepoint) |
void |
rollback() |
void |
rollback(java.sql.Savepoint savepoint) |
void |
setAutoCommit(boolean autoCommit) |
void |
setCatalog(java.lang.String catalog) |
void |
setHoldability(int holdability) |
void |
setReadOnly(boolean readOnly) |
java.sql.Savepoint |
setSavepoint() |
java.sql.Savepoint |
setSavepoint(java.lang.String name) |
void |
setTransactionIsolation(int level) |
void |
setTypeMap(java.util.Map map) |
java.lang.String |
toString()
Returns a string representation of the metadata associated with
the innnermost delegate connection.
|
abort, activate, createArrayOf, createBlob, createClob, createNClob, createSQLXML, createStruct, getClientInfo, getClientInfo, getDelegateInternal, getInnermostDelegateInternal, getNetworkTimeout, getSchema, handleException, innermostDelegateEquals, isValid, isWrapperFor, passivate, setClientInfo, setClientInfo, setDelegate, setNetworkTimeout, setSchema, unwrap
addTrace, clearTrace, getConfig, getLastUsed, getTrace, printStackTrace, removeTrace, setLastUsed, setLastUsed, setStackTrace
private final org.apache.commons.pool.ObjectPool pool
private java.sql.Connection delegate
PoolGuardConnectionWrapper(org.apache.commons.pool.ObjectPool pool, java.sql.Connection delegate)
protected void checkOpen() throws java.sql.SQLException
checkOpen
in class DelegatingConnection
java.sql.SQLException
public void close() throws java.sql.SQLException
DelegatingConnection
close
in interface java.lang.AutoCloseable
close
in interface java.sql.Connection
close
in class DelegatingConnection
java.sql.SQLException
public boolean isClosed() throws java.sql.SQLException
isClosed
in interface java.sql.Connection
isClosed
in class DelegatingConnection
java.sql.SQLException
public void clearWarnings() throws java.sql.SQLException
clearWarnings
in interface java.sql.Connection
clearWarnings
in class DelegatingConnection
java.sql.SQLException
public void commit() throws java.sql.SQLException
commit
in interface java.sql.Connection
commit
in class DelegatingConnection
java.sql.SQLException
public java.sql.Statement createStatement() throws java.sql.SQLException
createStatement
in interface java.sql.Connection
createStatement
in class DelegatingConnection
java.sql.SQLException
public java.sql.Statement createStatement(int resultSetType, int resultSetConcurrency) throws java.sql.SQLException
createStatement
in interface java.sql.Connection
createStatement
in class DelegatingConnection
java.sql.SQLException
public boolean equals(java.lang.Object obj)
DelegatingConnection
equals
in class DelegatingConnection
public boolean getAutoCommit() throws java.sql.SQLException
getAutoCommit
in interface java.sql.Connection
getAutoCommit
in class DelegatingConnection
java.sql.SQLException
public java.lang.String getCatalog() throws java.sql.SQLException
getCatalog
in interface java.sql.Connection
getCatalog
in class DelegatingConnection
java.sql.SQLException
public java.sql.DatabaseMetaData getMetaData() throws java.sql.SQLException
getMetaData
in interface java.sql.Connection
getMetaData
in class DelegatingConnection
java.sql.SQLException
public int getTransactionIsolation() throws java.sql.SQLException
getTransactionIsolation
in interface java.sql.Connection
getTransactionIsolation
in class DelegatingConnection
java.sql.SQLException
public java.util.Map getTypeMap() throws java.sql.SQLException
getTypeMap
in interface java.sql.Connection
getTypeMap
in class DelegatingConnection
java.sql.SQLException
public java.sql.SQLWarning getWarnings() throws java.sql.SQLException
getWarnings
in interface java.sql.Connection
getWarnings
in class DelegatingConnection
java.sql.SQLException
public int hashCode()
hashCode
in class DelegatingConnection
public boolean isReadOnly() throws java.sql.SQLException
isReadOnly
in interface java.sql.Connection
isReadOnly
in class DelegatingConnection
java.sql.SQLException
public java.lang.String nativeSQL(java.lang.String sql) throws java.sql.SQLException
nativeSQL
in interface java.sql.Connection
nativeSQL
in class DelegatingConnection
java.sql.SQLException
public java.sql.CallableStatement prepareCall(java.lang.String sql) throws java.sql.SQLException
prepareCall
in interface java.sql.Connection
prepareCall
in class DelegatingConnection
java.sql.SQLException
public java.sql.CallableStatement prepareCall(java.lang.String sql, int resultSetType, int resultSetConcurrency) throws java.sql.SQLException
prepareCall
in interface java.sql.Connection
prepareCall
in class DelegatingConnection
java.sql.SQLException
public java.sql.PreparedStatement prepareStatement(java.lang.String sql) throws java.sql.SQLException
prepareStatement
in interface java.sql.Connection
prepareStatement
in class DelegatingConnection
java.sql.SQLException
public java.sql.PreparedStatement prepareStatement(java.lang.String sql, int resultSetType, int resultSetConcurrency) throws java.sql.SQLException
prepareStatement
in interface java.sql.Connection
prepareStatement
in class DelegatingConnection
java.sql.SQLException
public void rollback() throws java.sql.SQLException
rollback
in interface java.sql.Connection
rollback
in class DelegatingConnection
java.sql.SQLException
public void setAutoCommit(boolean autoCommit) throws java.sql.SQLException
setAutoCommit
in interface java.sql.Connection
setAutoCommit
in class DelegatingConnection
java.sql.SQLException
public void setCatalog(java.lang.String catalog) throws java.sql.SQLException
setCatalog
in interface java.sql.Connection
setCatalog
in class DelegatingConnection
java.sql.SQLException
public void setReadOnly(boolean readOnly) throws java.sql.SQLException
setReadOnly
in interface java.sql.Connection
setReadOnly
in class DelegatingConnection
java.sql.SQLException
public void setTransactionIsolation(int level) throws java.sql.SQLException
setTransactionIsolation
in interface java.sql.Connection
setTransactionIsolation
in class DelegatingConnection
java.sql.SQLException
public void setTypeMap(java.util.Map map) throws java.sql.SQLException
setTypeMap
in interface java.sql.Connection
setTypeMap
in class DelegatingConnection
java.sql.SQLException
public java.lang.String toString()
DelegatingConnection
toString
in class DelegatingConnection
public int getHoldability() throws java.sql.SQLException
getHoldability
in interface java.sql.Connection
getHoldability
in class DelegatingConnection
java.sql.SQLException
public void setHoldability(int holdability) throws java.sql.SQLException
setHoldability
in interface java.sql.Connection
setHoldability
in class DelegatingConnection
java.sql.SQLException
public java.sql.Savepoint setSavepoint() throws java.sql.SQLException
setSavepoint
in interface java.sql.Connection
setSavepoint
in class DelegatingConnection
java.sql.SQLException
public java.sql.Savepoint setSavepoint(java.lang.String name) throws java.sql.SQLException
setSavepoint
in interface java.sql.Connection
setSavepoint
in class DelegatingConnection
java.sql.SQLException
public void releaseSavepoint(java.sql.Savepoint savepoint) throws java.sql.SQLException
releaseSavepoint
in interface java.sql.Connection
releaseSavepoint
in class DelegatingConnection
java.sql.SQLException
public void rollback(java.sql.Savepoint savepoint) throws java.sql.SQLException
rollback
in interface java.sql.Connection
rollback
in class DelegatingConnection
java.sql.SQLException
public java.sql.Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws java.sql.SQLException
createStatement
in interface java.sql.Connection
createStatement
in class DelegatingConnection
java.sql.SQLException
public java.sql.CallableStatement prepareCall(java.lang.String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws java.sql.SQLException
prepareCall
in interface java.sql.Connection
prepareCall
in class DelegatingConnection
java.sql.SQLException
public java.sql.PreparedStatement prepareStatement(java.lang.String sql, int autoGeneratedKeys) throws java.sql.SQLException
prepareStatement
in interface java.sql.Connection
prepareStatement
in class DelegatingConnection
java.sql.SQLException
public java.sql.PreparedStatement prepareStatement(java.lang.String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws java.sql.SQLException
prepareStatement
in interface java.sql.Connection
prepareStatement
in class DelegatingConnection
java.sql.SQLException
public java.sql.PreparedStatement prepareStatement(java.lang.String sql, int[] columnIndexes) throws java.sql.SQLException
prepareStatement
in interface java.sql.Connection
prepareStatement
in class DelegatingConnection
java.sql.SQLException
public java.sql.PreparedStatement prepareStatement(java.lang.String sql, java.lang.String[] columnNames) throws java.sql.SQLException
prepareStatement
in interface java.sql.Connection
prepareStatement
in class DelegatingConnection
java.sql.SQLException
public java.sql.Connection getDelegate()
DelegatingConnection
Connection
.getDelegate
in class DelegatingConnection
Connection
.DelegatingConnection.getDelegate()
public java.sql.Connection getInnermostDelegate()
DelegatingConnection
Connection
is not a
DelegatingConnection, returns it,
otherwise recursively invokes this method on
my delegate.
Hence this method will return the first delegate that is not a DelegatingConnection, or null when no non-DelegatingConnection delegate can be found by traversing this chain.
This method is useful when you may have nested
DelegatingConnections, and you want to make
sure to obtain a "genuine" Connection
.
getInnermostDelegate
in class DelegatingConnection
DelegatingConnection.getInnermostDelegate()