org.apache.commons.dbcp
Class PoolableConnection

java.lang.Object
  extended byorg.apache.commons.dbcp.AbandonedTrace
      extended byorg.apache.commons.dbcp.DelegatingConnection
          extended byorg.apache.commons.dbcp.PoolableConnection
All Implemented Interfaces:
Connection

public class PoolableConnection
extends DelegatingConnection

A delegating connection that, rather than closing the underlying connection, returns itself to an ObjectPool when closed.

Version:
$Revision: 892307 $ $Date: 2014-01-01 00:27:28 +0100 (Wed, 01 Jan 2014) $
Author:
Rodney Waldhoff, Glenn L. Nielsen, James House

Field Summary
protected  ObjectPool _pool
          The pool to which I should return.
 
Fields inherited from class org.apache.commons.dbcp.DelegatingConnection
_closed, _conn
 
Fields inherited from interface java.sql.Connection
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE
 
Constructor Summary
PoolableConnection(Connection conn, ObjectPool pool)
           
PoolableConnection(Connection conn, ObjectPool pool, AbandonedConfig config)
          Deprecated. AbandonedConfig is now deprecated.
 
Method Summary
 void close()
          Returns me to my pool.
 void reallyClose()
          Actually close my underlying Connection.
 
Methods inherited from class org.apache.commons.dbcp.DelegatingConnection
activate, checkOpen, clearWarnings, commit, createStatement, createStatement, createStatement, equals, getAutoCommit, getCatalog, getDelegate, getHoldability, getInnermostDelegate, getMetaData, getTransactionIsolation, getTypeMap, getWarnings, handleException, hashCode, innermostDelegateEquals, isClosed, isReadOnly, nativeSQL, passivate, prepareCall, prepareCall, prepareCall, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, releaseSavepoint, rollback, rollback, setAutoCommit, setCatalog, setDelegate, setHoldability, setReadOnly, setSavepoint, setSavepoint, setTransactionIsolation, setTypeMap, toString
 
Methods inherited from class org.apache.commons.dbcp.AbandonedTrace
addTrace, clearTrace, getConfig, getLastUsed, getTrace, printStackTrace, removeTrace, setLastUsed, setLastUsed, setStackTrace
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

_pool

protected ObjectPool _pool
The pool to which I should return.

Constructor Detail

PoolableConnection

public PoolableConnection(Connection conn,
                          ObjectPool pool)
Parameters:
conn - my underlying connection
pool - the pool to which I should return when closed

PoolableConnection

public PoolableConnection(Connection conn,
                          ObjectPool pool,
                          AbandonedConfig config)
Deprecated. AbandonedConfig is now deprecated.

Parameters:
conn - my underlying connection
pool - the pool to which I should return when closed
config - the abandoned configuration settings
Method Detail

close

public void close()
           throws SQLException
Returns me to my pool.

Specified by:
close in interface Connection
Overrides:
close in class DelegatingConnection
Throws:
SQLException

reallyClose

public void reallyClose()
                 throws SQLException
Actually close my underlying Connection.

Throws:
SQLException


Copyright © The Apache Software Foundation. All Rights Reserved.