com.cafesoft.core.jdbc
Class PoolableConnection

java.lang.Object
  |
  +--com.cafesoft.core.jdbc.DelegatingConnection
        |
        +--com.cafesoft.core.jdbc.PoolableConnection
All Implemented Interfaces:
Connection

public class PoolableConnection
extends DelegatingConnection

An extended version of the DelegatingConnection class. The primary difference is the close() method. The PoolableConnection's close method returns the Connection object to the ConnectionPool.

Since:
10/31/02
See Also:
Connection, DelegatingConnection

Field Summary
 
Fields inherited from class com.cafesoft.core.jdbc.DelegatingConnection
closed, connection
 
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, ConnectionPool pool)
          Create a new PoolableConnection object
 
Method Summary
 void close()
          Releases this Connection object's database and JDBC resources immediately instead of waiting for them to be automatically released.
 void reallyClose()
          Really close the connection do not just return it to it's object pool
 
Methods inherited from class com.cafesoft.core.jdbc.DelegatingConnection
activate, addStatement, checkOpen, clearWarnings, commit, createStatement, createStatement, createStatement, getAutoCommit, getCatalog, getHoldability, getInfo, getMetaData, getTransactionIsolation, getTypeMap, getWarnings, isClosed, isReadOnly, nativeSQL, passivate, prepareCall, prepareCall, prepareCall, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, releaseSavepoint, removeStatement, rollback, rollback, setAutoCommit, setCatalog, setHoldability, setReadOnly, setSavepoint, setSavepoint, setTransactionIsolation, setTypeMap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PoolableConnection

public PoolableConnection(Connection conn,
                          ConnectionPool pool)
Create a new PoolableConnection object

Parameters:
conn - the underlying Connection to delegate all method calls to
pool - the ConnectionPool the Connection returns to when closed
Method Detail

reallyClose

public void reallyClose()
                 throws SQLException
Really close the connection do not just return it to it's object pool

Throws:
SQLException - thrown if an error occurs closing the Connection

close

public void close()
           throws SQLException
Releases this Connection object's database and JDBC resources immediately instead of waiting for them to be automatically released.

Calling the method close on a Connection object that is already closed is a no-op.

Note: A Connection object is automatically closed when it is garbage collected. Certain fatal errors also close a Connection object.

Specified by:
close in interface Connection
Overrides:
close in class DelegatingConnection
Throws:
SQLException - if a database access error occurs


Generated on 8:41:50 AM June 06, 2005, © 1996-2005 Cafésoft LLC. All rights reserved.