Class PoolableConnection
java.lang.Object
org.apache.commons.dbcp.AbandonedTrace
org.apache.commons.dbcp.DelegatingConnection
org.apache.commons.dbcp.PoolableConnection
- All Implemented Interfaces:
AutoCloseable, Connection, Wrapper
- Direct Known Subclasses:
PoolableManagedConnection
A delegating connection that, rather than closing the underlying
connection, returns itself to an
ObjectPool when
closed.- Version:
- $Revision: 758745 $ $Date: 2009-03-26 13:02:20 -0400 (Thu, 26 Mar 2009) $
- Author:
- Rodney Waldhoff, Glenn L. Nielsen, James House
-
Field Summary
Fields inherited from interface Connection
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE -
Constructor Summary
ConstructorsConstructorDescriptionPoolableConnection(Connection conn, org.apache.commons.pool.ObjectPool pool) PoolableConnection(Connection conn, org.apache.commons.pool.ObjectPool pool, AbandonedConfig config) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Returns me to my pool.voidActually close my underlyingConnection.Methods inherited from class DelegatingConnection
abort, clearWarnings, commit, createArrayOf, createBlob, createClob, createNClob, createSQLXML, createStatement, createStatement, createStatement, createStruct, equals, getAutoCommit, getCatalog, getClientInfo, getClientInfo, getDelegate, getHoldability, getInnermostDelegate, getMetaData, getNetworkTimeout, getSchema, getTransactionIsolation, getTypeMap, getWarnings, hashCode, innermostDelegateEquals, isClosed, isReadOnly, isValid, isWrapperFor, nativeSQL, prepareCall, prepareCall, prepareCall, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, releaseSavepoint, rollback, rollback, setAutoCommit, setCatalog, setClientInfo, setClientInfo, setDelegate, setHoldability, setNetworkTimeout, setReadOnly, setSavepoint, setSavepoint, setSchema, setTransactionIsolation, setTypeMap, toString, unwrapMethods inherited from class AbandonedTrace
printStackTraceMethods inherited from interface Connection
beginRequest, endRequest, setShardingKey, setShardingKey, setShardingKeyIfValid, setShardingKeyIfValid
-
Constructor Details
-
PoolableConnection
- Parameters:
conn- my underlying connectionpool- the pool to which I should return when closed
-
PoolableConnection
public PoolableConnection(Connection conn, org.apache.commons.pool.ObjectPool pool, AbandonedConfig config) - Parameters:
conn- my underlying connectionpool- the pool to which I should return when closedconfig- the abandoned configuration settings
-
-
Method Details
-
close
Returns me to my pool.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceConnection- Overrides:
closein classDelegatingConnection- Throws:
SQLException
-
reallyClose
Actually close my underlyingConnection.- Throws:
SQLException
-