Class PoolingConnection

All Implemented Interfaces:
AutoCloseable, Connection, Wrapper, KeyedPooledObjectFactory<PStmtKey,DelegatingPreparedStatement>, TrackedUse

A DelegatingConnection that pools PreparedStatements.

The prepareStatement(org.apache.commons.dbcp2.PStmtKey) and prepareCall(org.apache.commons.dbcp2.PStmtKey) 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
See Also: