Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.commons.dbcp
Class PoolablePreparedStatement  view PoolablePreparedStatement download PoolablePreparedStatement.java

java.lang.Object
  extended byorg.apache.commons.dbcp.AbandonedTrace
      extended byorg.apache.commons.dbcp.DelegatingStatement
          extended byorg.apache.commons.dbcp.DelegatingPreparedStatement
              extended byorg.apache.commons.dbcp.PoolablePreparedStatement
All Implemented Interfaces:
java.sql.PreparedStatement, java.sql.Statement

public class PoolablePreparedStatement
extends DelegatingPreparedStatement
implements java.sql.PreparedStatement

A DelegatingPreparedStatement that cooperates with PoolingConnection to implement a pool of java.sql.PreparedStatements.

My close() 55 method returns me to my containing pool. (See PoolingConnection.)

Version:
$Revision: 1.11 $ $Date: 2004/03/07 10:50:37 $

Field Summary
protected  java.lang.Object _key
          My "key" as used by org.apache.commons.pool.KeyedObjectPool.
protected  org.apache.commons.pool.KeyedObjectPool _pool
          The org.apache.commons.pool.KeyedObjectPool from which I was obtained.
 
Fields inherited from class org.apache.commons.dbcp.DelegatingPreparedStatement
_stmt
 
Fields inherited from class org.apache.commons.dbcp.DelegatingStatement
_closed, _conn
 
Fields inherited from class org.apache.commons.dbcp.AbandonedTrace
 
Fields inherited from interface java.sql.Statement
CLOSE_ALL_RESULTS, CLOSE_CURRENT_RESULT, EXECUTE_FAILED, KEEP_CURRENT_RESULT, NO_GENERATED_KEYS, RETURN_GENERATED_KEYS, SUCCESS_NO_INFO
 
Constructor Summary
PoolablePreparedStatement(java.sql.PreparedStatement stmt, java.lang.Object key, org.apache.commons.pool.KeyedObjectPool pool, java.sql.Connection conn)
          Constructor
 
Method Summary
protected  void activate()
           
 void close()
          Return me to my pool.
protected  void passivate()
           
 
Methods inherited from class org.apache.commons.dbcp.DelegatingPreparedStatement
addBatch, clearParameters, equals, execute, executeQuery, executeUpdate, getMetaData, getParameterMetaData, setArray, setAsciiStream, setBigDecimal, setBinaryStream, setBlob, setBoolean, setByte, setBytes, setCharacterStream, setClob, setDate, setDate, setDelegate, setDouble, setFloat, setInt, setLong, setNull, setNull, setObject, setObject, setObject, setRef, setShort, setString, setTime, setTime, setTimestamp, setTimestamp, setUnicodeStream, setURL
 
Methods inherited from class org.apache.commons.dbcp.DelegatingStatement
addBatch, cancel, checkOpen, clearBatch, clearWarnings, execute, execute, execute, execute, executeBatch, executeQuery, executeUpdate, executeUpdate, executeUpdate, executeUpdate, getConnection, getDelegate, getFetchDirection, getFetchSize, getGeneratedKeys, getInnermostDelegate, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, handleException, hashCode, isClosed, setCursorName, setDelegate, setEscapeProcessing, setFetchDirection, setFetchSize, setMaxFieldSize, setMaxRows, setQueryTimeout
 
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, toString, wait, wait, wait
 
Methods inherited from interface java.sql.PreparedStatement
addBatch, clearParameters, execute, executeQuery, executeUpdate, getMetaData, getParameterMetaData, setArray, setAsciiStream, setBigDecimal, setBinaryStream, setBlob, setBoolean, setByte, setBytes, setCharacterStream, setClob, setDate, setDate, setDouble, setFloat, setInt, setLong, setNull, setNull, setObject, setObject, setObject, setRef, setShort, setString, setTime, setTime, setTimestamp, setTimestamp, setUnicodeStream, setURL
 
Methods inherited from interface java.sql.Statement
addBatch, cancel, clearBatch, clearWarnings, execute, execute, execute, execute, executeBatch, executeQuery, executeUpdate, executeUpdate, executeUpdate, executeUpdate, getConnection, getFetchDirection, getFetchSize, getGeneratedKeys, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setMaxFieldSize, setMaxRows, setQueryTimeout
 

Field Detail

_pool

protected org.apache.commons.pool.KeyedObjectPool _pool
The org.apache.commons.pool.KeyedObjectPool from which I was obtained.


_key

protected java.lang.Object _key
My "key" as used by org.apache.commons.pool.KeyedObjectPool.

Constructor Detail

PoolablePreparedStatement

public PoolablePreparedStatement(java.sql.PreparedStatement stmt,
                                 java.lang.Object key,
                                 org.apache.commons.pool.KeyedObjectPool pool,
                                 java.sql.Connection conn)
Constructor

Method Detail

close

public void close()
           throws java.sql.SQLException
Return me to my pool.

Specified by:
close in interface java.sql.Statement
Overrides:
close in class DelegatingStatement

activate

protected void activate()
                 throws java.sql.SQLException
Overrides:
activate in class DelegatingStatement

passivate

protected void passivate()
                  throws java.sql.SQLException
Overrides:
passivate in class DelegatingStatement