Class PoolablePreparedStatement<K>
java.lang.Object
org.datanucleus.store.rdbms.datasource.dbcp2.AbandonedTrace
org.datanucleus.store.rdbms.datasource.dbcp2.DelegatingStatement
org.datanucleus.store.rdbms.datasource.dbcp2.DelegatingPreparedStatement
org.datanucleus.store.rdbms.datasource.dbcp2.PoolablePreparedStatement<K>
- Type Parameters:
K- the key type
- All Implemented Interfaces:
AutoCloseable, PreparedStatement, Statement, Wrapper, TrackedUse
A
DelegatingPreparedStatement that cooperates with PoolingConnection to implement a pool of
PreparedStatements.
My close() method returns me to my containing pool. (See PoolingConnection.)
- Since:
- 2.0
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate final KMy "key" as used byKeyedObjectPool.private final KeyedObjectPool<K, PoolablePreparedStatement<K>> TheKeyedObjectPoolfrom which I was obtained.Fields inherited from interface Statement
CLOSE_ALL_RESULTS, CLOSE_CURRENT_RESULT, EXECUTE_FAILED, KEEP_CURRENT_RESULT, NO_GENERATED_KEYS, RETURN_GENERATED_KEYS, SUCCESS_NO_INFO -
Constructor Summary
ConstructorsConstructorDescriptionPoolablePreparedStatement(PreparedStatement stmt, K key, KeyedObjectPool<K, PoolablePreparedStatement<K>> pool, DelegatingConnection<?> conn) Constructor. -
Method Summary
Methods inherited from class DelegatingPreparedStatement
clearParameters, execute, executeLargeUpdate, 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, setObject, setObject, setRef, setRowId, setShort, setSQLXML, setString, setTime, setTime, setTimestamp, setTimestamp, setUnicodeStream, setURL, toStringMethods inherited from class DelegatingStatement
addBatch, cancel, checkOpen, clearWarnings, closeOnCompletion, execute, execute, execute, execute, executeBatch, executeLargeBatch, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeQuery, executeUpdate, executeUpdate, executeUpdate, executeUpdate, finalize, getConnection, getConnectionInternal, getDelegate, getFetchDirection, getFetchSize, getGeneratedKeys, getInnermostDelegate, getLargeMaxRows, getLargeUpdateCount, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, handleException, isClosed, isClosedInternal, isCloseOnCompletion, isPoolable, isWrapperFor, setClosedInternal, setCursorName, setDelegate, setEscapeProcessing, setFetchDirection, setFetchSize, setLargeMaxRows, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeout, unwrapMethods inherited from class AbandonedTrace
addTrace, clearTrace, getLastUsed, getTrace, removeThisTrace, removeTrace, setLastUsed, setLastUsedMethods inherited from class Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Statement
addBatch, 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, setQueryTimeoutMethods inherited from interface Wrapper
isWrapperFor, unwrap
-
Field Details
-
pool
TheKeyedObjectPoolfrom which I was obtained. -
key
My "key" as used byKeyedObjectPool. -
batchAdded
private volatile boolean batchAdded
-
-
Constructor Details
-
PoolablePreparedStatement
public PoolablePreparedStatement(PreparedStatement stmt, K key, KeyedObjectPool<K, PoolablePreparedStatement<K>> pool, DelegatingConnection<?> conn) Constructor.- Parameters:
stmt- my underlyingPreparedStatementkey- my key" as used byKeyedObjectPoolpool- theKeyedObjectPoolfrom which I was obtained.conn- theConnectionfrom which I was created
-
-
Method Details
-
addBatch
Add batch.- Specified by:
addBatchin interfacePreparedStatement- Overrides:
addBatchin classDelegatingPreparedStatement- Throws:
SQLException
-
clearBatch
Clear Batch.- Specified by:
clearBatchin interfaceStatement- Overrides:
clearBatchin classDelegatingStatement- Throws:
SQLException
-
close
Return me to my pool.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceStatement- Overrides:
closein classDelegatingStatement- Throws:
SQLException
-
activate
- Overrides:
activatein classDelegatingStatement- Throws:
SQLException- thrown by the delegating statement.
-
passivate
- Overrides:
passivatein classDelegatingStatement- Throws:
SQLException- thrown by the delegating statement.
-