Class PoolingConnection

All Implemented Interfaces:
AutoCloseable, Connection, Wrapper, org.apache.commons.pool2.KeyedPooledObjectFactory<PStmtKey,DelegatingPreparedStatement>, org.apache.commons.pool2.TrackedUse

public class PoolingConnection extends DelegatingConnection<Connection> implements org.apache.commons.pool2.KeyedPooledObjectFactory<PStmtKey,DelegatingPreparedStatement>
A DelegatingConnection that pools PreparedStatements.

The prepareStatement(java.lang.String) and prepareCall(java.lang.String) methods, rather than creating a new PreparedStatement each time, may actually pull the statement from a pool of unused statements. The Statement.close() method of the returned statement doesn't actually close the statement, but rather returns it to the pool. (See PoolablePreparedStatement, PoolableCallableStatement.)

Since:
2.0
Version:
$Id: PoolingConnection.java 1658644 2015-02-10 08:59:07Z tn $
Author:
Rodney Waldhoff, Dirk Verbeeck
See Also: