Package org.apache.tomcat.dbcp.dbcp2
Class PoolablePreparedStatement<K>
- java.lang.Object
- 
- org.apache.tomcat.dbcp.dbcp2.AbandonedTrace
- 
- org.apache.tomcat.dbcp.dbcp2.DelegatingStatement
- 
- org.apache.tomcat.dbcp.dbcp2.DelegatingPreparedStatement
- 
- org.apache.tomcat.dbcp.dbcp2.PoolablePreparedStatement<K>
 
 
 
 
- 
- Type Parameters:
- K- the key type
 - All Implemented Interfaces:
- java.lang.AutoCloseable,- java.sql.PreparedStatement,- java.sql.Statement,- java.sql.Wrapper,- TrackedUse
 
 public class PoolablePreparedStatement<K> extends DelegatingPreparedStatement ADelegatingPreparedStatementthat cooperates withPoolingConnectionto implement a pool ofPreparedStatements.My close()method returns me to my containing pool. (SeePoolingConnection.)- Since:
- 2.0
- See Also:
- PoolingConnection
 
- 
- 
Constructor SummaryConstructors Constructor Description PoolablePreparedStatement(java.sql.PreparedStatement stmt, K key, KeyedObjectPool<K,PoolablePreparedStatement<K>> pool, DelegatingConnection<?> conn)Constructor.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactivate()voidaddBatch()Add batch.voidclearBatch()Clear Batch.voidclose()Return me to my pool.voidpassivate()- 
Methods inherited from class org.apache.tomcat.dbcp.dbcp2.DelegatingPreparedStatementclearParameters, 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, toString
 - 
Methods inherited from class org.apache.tomcat.dbcp.dbcp2.DelegatingStatementaddBatch, cancel, checkOpen, clearWarnings, closeOnCompletion, execute, execute, execute, execute, executeBatch, executeQuery, executeUpdate, executeUpdate, executeUpdate, executeUpdate, finalize, getConnection, getConnectionInternal, getDelegate, getFetchDirection, getFetchSize, getGeneratedKeys, getInnermostDelegate, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, handleException, isClosed, isClosedInternal, isCloseOnCompletion, isPoolable, isWrapperFor, setClosedInternal, setCursorName, setDelegate, setEscapeProcessing, setFetchDirection, setFetchSize, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeout, unwrap
 - 
Methods inherited from class org.apache.tomcat.dbcp.dbcp2.AbandonedTraceaddTrace, clearTrace, getLastUsed, getTrace, removeThisTrace, removeTrace, setLastUsed, setLastUsed
 - 
Methods inherited from class java.lang.Objectclone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 - 
Methods inherited from interface java.sql.PreparedStatementexecuteLargeUpdate, setObject, setObject
 - 
Methods inherited from interface java.sql.StatementaddBatch, cancel, clearWarnings, closeOnCompletion, enquoteIdentifier, enquoteLiteral, enquoteNCharLiteral, execute, execute, execute, execute, executeBatch, executeLargeBatch, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeQuery, executeUpdate, executeUpdate, executeUpdate, executeUpdate, getConnection, getFetchDirection, getFetchSize, getGeneratedKeys, getLargeMaxRows, getLargeUpdateCount, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, isClosed, isCloseOnCompletion, isPoolable, isSimpleIdentifier, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setLargeMaxRows, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeout
 
- 
 
- 
- 
- 
Constructor Detail- 
PoolablePreparedStatementpublic PoolablePreparedStatement(java.sql.PreparedStatement stmt, K key, KeyedObjectPool<K,PoolablePreparedStatement<K>> pool, DelegatingConnection<?> conn)Constructor.- Parameters:
- stmt- my underlying- PreparedStatement
- key- my key" as used by- KeyedObjectPool
- pool- the- KeyedObjectPoolfrom which I was obtained.
- conn- the- Connectionfrom which I was created
 
 
- 
 - 
Method Detail- 
addBatchpublic void addBatch() throws java.sql.SQLExceptionAdd batch.- Specified by:
- addBatchin interface- java.sql.PreparedStatement
- Overrides:
- addBatchin class- DelegatingPreparedStatement
- Throws:
- java.sql.SQLException
 
 - 
clearBatchpublic void clearBatch() throws java.sql.SQLExceptionClear Batch.- Specified by:
- clearBatchin interface- java.sql.Statement
- Overrides:
- clearBatchin class- DelegatingStatement
- Throws:
- java.sql.SQLException
 
 - 
closepublic void close() throws java.sql.SQLExceptionReturn me to my pool.- Specified by:
- closein interface- java.lang.AutoCloseable
- Specified by:
- closein interface- java.sql.Statement
- Overrides:
- closein class- DelegatingStatement
- Throws:
- java.sql.SQLException
 
 - 
activatepublic void activate() throws java.sql.SQLException- Overrides:
- activatein class- DelegatingStatement
- Throws:
- java.sql.SQLException- thrown by the delegating statement.
 
 - 
passivatepublic void passivate() throws java.sql.SQLException- Overrides:
- passivatein class- DelegatingStatement
- Throws:
- java.sql.SQLException- thrown by the delegating statement.
 
 
- 
 
-