| java.lang.Object org.apache.commons.dbcp.AbandonedTrace org.apache.commons.dbcp.DelegatingConnection
All known Subclasses: org.apache.commons.dbcp.PoolableConnection, org.apache.commons.dbcp.PoolingConnection,
DelegatingConnection | public class DelegatingConnection extends AbandonedTrace implements Connection(Code) | | A base delegating implementation of
Connection .
All of the methods from the
Connection interface
simply check to see that the
Connection is active,
and call the corresponding method on the "delegate"
provided in my constructor.
Extends AbandonedTrace to implement Connection tracking and
logging of code which created the Connection. Tracking the
Connection ensures that the AbandonedObjectPool can close
this connection and recycle it if its pool of connections
is nearing exhaustion and this connection's last usage is
older than the removeAbandonedTimeout.
author: Rodney Waldhoff author: Glenn L. Nielsen author: James House author: Dirk Verbeeck version: $Revision: 500687 $ $Date: 2007-01-27 16:33:47 -0700 (Sat, 27 Jan 2007) $ |
Method Summary | |
protected void | activate() | protected void | checkOpen() | public void | clearWarnings() | public void | close() Closes the underlying connection, and close
any Statements that were not explicitly closed. | public void | commit() | public Statement | createStatement() | public Statement | createStatement(int resultSetType, int resultSetConcurrency) | public Statement | createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) | public boolean | equals(Object obj) | public boolean | getAutoCommit() | public String | getCatalog() | public Connection | getDelegate() Returns my underlying
Connection . | public int | getHoldability() | public Connection | getInnermostDelegate() If my underlying
Connection is not a
DelegatingConnection, returns it,
otherwise recursively invokes this method on
my delegate. | public DatabaseMetaData | getMetaData() | public int | getTransactionIsolation() | public Map | getTypeMap() | public SQLWarning | getWarnings() | protected void | handleException(SQLException e) | public int | hashCode() | public boolean | innermostDelegateEquals(Connection c) Compares innermost delegate to the given connection. | public boolean | isClosed() | public boolean | isReadOnly() | public String | nativeSQL(String sql) | protected void | passivate() | public CallableStatement | prepareCall(String sql) | public CallableStatement | prepareCall(String sql, int resultSetType, int resultSetConcurrency) | public CallableStatement | prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) | public PreparedStatement | prepareStatement(String sql) | public PreparedStatement | prepareStatement(String sql, int resultSetType, int resultSetConcurrency) | public PreparedStatement | prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) | public PreparedStatement | prepareStatement(String sql, int autoGeneratedKeys) | public PreparedStatement | prepareStatement(String sql, int columnIndexes) | public PreparedStatement | prepareStatement(String sql, String columnNames) | public void | releaseSavepoint(java.sql.Savepoint savepoint) | public void | rollback() | public void | rollback(java.sql.Savepoint savepoint) | public void | setAutoCommit(boolean autoCommit) | public void | setCatalog(String catalog) | public void | setDelegate(Connection c) Sets my delegate. | public void | setHoldability(int holdability) | public void | setReadOnly(boolean readOnly) | public java.sql.Savepoint | setSavepoint() | public java.sql.Savepoint | setSavepoint(String name) | public void | setTransactionIsolation(int level) | public void | setTypeMap(Map map) | public String | toString() Returns a string representation of the metadata associated with
the innnermost delegate connection. |
_closed | protected boolean _closed(Code) | | |
DelegatingConnection | public DelegatingConnection(Connection c)(Code) | | Create a wrapper for the Connectin which traces this
Connection in the AbandonedObjectPool.
Parameters: c - the Connection to delegate all calls to. |
DelegatingConnection | public DelegatingConnection(Connection c, AbandonedConfig config)(Code) | | Create a wrapper for the Connection which traces
the Statements created so that any unclosed Statements
can be closed when this Connection is closed.
Parameters: c - the Connection to delegate all calls to. Parameters: config - the configuration for tracing abandoned objects |
activate | protected void activate()(Code) | | |
close | public void close() throws SQLException(Code) | | Closes the underlying connection, and close
any Statements that were not explicitly closed.
|
createStatement | public Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException(Code) | | |
getInnermostDelegate | public Connection getInnermostDelegate()(Code) | | If my underlying
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 transversing this chain.
This method is useful when you may have nested
DelegatingConnections, and you want to make
sure to obtain a "genuine"
Connection .
|
hashCode | public int hashCode()(Code) | | |
innermostDelegateEquals | public boolean innermostDelegateEquals(Connection c)(Code) | | Compares innermost delegate to the given connection.
Parameters: c - connection to compare innermost delegate with true if innermost delegate equals c since: 1.2.2 |
setTransactionIsolation | public void setTransactionIsolation(int level) throws SQLException(Code) | | |
toString | public String toString()(Code) | | Returns a string representation of the metadata associated with
the innnermost delegate connection.
since: 1.2.2 |
|
|