Package org.apache.commons.dbcp
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 java.sql.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 TypeMethodDescriptionvoid
close()
Returns me to my pool.void
Actually close my underlyingConnection
.Methods inherited from class org.apache.commons.dbcp.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, unwrap
Methods inherited from class org.apache.commons.dbcp.AbandonedTrace
printStackTrace
Methods inherited from interface java.sql.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:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceConnection
- Overrides:
close
in classDelegatingConnection
- Throws:
SQLException
-
reallyClose
Actually close my underlyingConnection
.- Throws:
SQLException
-