org.apache.commons.dbcp
Class PoolablePreparedStatement

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

public class PoolablePreparedStatement
extends DelegatingPreparedStatement
implements java.sql.PreparedStatement

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

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

Version:
$Revision: 745860 $ $Date: 2009-02-19 08:45:07 -0500 (Thu, 19 Feb 2009) $
Author:
Rodney Waldhoff, Glenn L. Nielsen, James House, Dirk Verbeeck
See Also:
PoolingConnection

Field Summary
 
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, KeyedObjectPool pool, java.sql.Connection conn)
          Constructor
 
Method Summary
 void addBatch()
          Add batch.
 void clearBatch()
          Clear Batch.
 void close()
          Return me to my pool.
 
Methods inherited from class org.apache.commons.dbcp.DelegatingPreparedStatement
clearParameters, equals, execute, executeQuery, executeUpdate, getMetaData, getParameterMetaData, setArray, setAsciiStream, setAsciiStream, setAsciiStream, setBigDecimal, setBinaryStream, setBinaryStream, setBinaryStream, setBlob, setBlob, setBlob, setBoolean, setByte, setBytes, setCharacterStream, setCharacterStream, setCharacterStream, setClob, setClob, setClob, setDate, setDate, setDelegate, setDouble, setFloat, setInt, setLong, setNCharacterStream, setNCharacterStream, setNClob, setNClob, setNClob, setNString, setNull, setNull, setObject, setObject, setObject, setRef, setRowId, setShort, setSQLXML, setString, setTime, setTime, setTimestamp, setTimestamp, setURL, toString
 
Methods inherited from class org.apache.commons.dbcp.DelegatingStatement
addBatch, cancel, 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, hashCode, isClosed, isPoolable, isWrapperFor, setCursorName, setDelegate, setEscapeProcessing, setFetchDirection, setFetchSize, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeout, unwrap
 
Methods inherited from class org.apache.commons.dbcp.AbandonedTrace
printStackTrace
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.sql.PreparedStatement
clearParameters, execute, executeQuery, executeUpdate, getMetaData, getParameterMetaData, setArray, setAsciiStream, setAsciiStream, setAsciiStream, setBigDecimal, setBinaryStream, setBinaryStream, setBinaryStream, setBlob, setBlob, setBlob, setBoolean, setByte, setBytes, setCharacterStream, setCharacterStream, setCharacterStream, setClob, setClob, setClob, setDate, setDate, setDouble, setFloat, setInt, setLong, setNCharacterStream, setNCharacterStream, setNClob, setNClob, setNClob, setNString, setNull, setNull, setObject, setObject, setObject, setRef, setRowId, setShort, setSQLXML, setString, setTime, setTime, setTimestamp, setTimestamp, setUnicodeStream, setURL
 
Methods inherited from interface java.sql.Statement
addBatch, cancel, 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, isClosed, isPoolable, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeout
 
Methods inherited from interface java.sql.Wrapper
isWrapperFor, unwrap
 

Constructor Detail

PoolablePreparedStatement

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

Parameters:
stmt - my underlying PreparedStatement
key - my key" as used by KeyedObjectPool
pool - the KeyedObjectPool from which I was obtained.
conn - the Connection from which I was created
Method Detail

addBatch

public void addBatch()
              throws java.sql.SQLException
Add batch.

Specified by:
addBatch in interface java.sql.PreparedStatement
Overrides:
addBatch in class DelegatingPreparedStatement
Throws:
java.sql.SQLException

clearBatch

public void clearBatch()
                throws java.sql.SQLException
Clear Batch.

Specified by:
clearBatch in interface java.sql.Statement
Overrides:
clearBatch in class DelegatingStatement
Throws:
java.sql.SQLException

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
Throws:
java.sql.SQLException


Copyright © 2001-2004 Apache Software Foundation. Documenation generated June 10 2013.