| java.lang.Object org.apache.commons.dbcp.datasources.KeyedCPDSConnectionFactory
KeyedCPDSConnectionFactory | class KeyedCPDSConnectionFactory implements KeyedPoolableObjectFactory,ConnectionEventListener(Code) | | A {*link PoolableObjectFactory} that creates
{*link PoolableConnection}s.
author: John D. McNally version: $Revision: 479137 $ $Date: 2006-11-25 08:51:48 -0700 (Sat, 25 Nov 2006) $ |
Constructor Summary | |
public | KeyedCPDSConnectionFactory(ConnectionPoolDataSource cpds, KeyedObjectPool pool, String validationQuery) Create a new KeyedPoolableConnectionFactory.
Parameters: cpds - the ConnectionPoolDataSource from which to obtain PooledConnection's Parameters: pool - the {*link ObjectPool} in which to pool those {*link Connection}s Parameters: validationQuery - a query to use to {*link #validateObject validate} {*link Connection}s. | public | KeyedCPDSConnectionFactory(ConnectionPoolDataSource cpds, KeyedObjectPool pool, String validationQuery, boolean rollbackAfterValidation) Create a new KeyedPoolableConnectionFactory.
Parameters: cpds - the ConnectionPoolDataSource from which to obtainPooledConnections Parameters: pool - the ObjectPool in which to pool thoseConnections Parameters: validationQuery - a query to use to KeyedCPDSConnectionFactory.validateObject validateConnections. |
_pool | protected KeyedObjectPool _pool(Code) | | |
_rollbackAfterValidation | protected boolean _rollbackAfterValidation(Code) | | |
KeyedCPDSConnectionFactory | public KeyedCPDSConnectionFactory(ConnectionPoolDataSource cpds, KeyedObjectPool pool, String validationQuery)(Code) | | Create a new KeyedPoolableConnectionFactory.
Parameters: cpds - the ConnectionPoolDataSource from which to obtain PooledConnection's Parameters: pool - the {*link ObjectPool} in which to pool those {*link Connection}s Parameters: validationQuery - a query to use to {*link #validateObject validate} {*link Connection}s. Should return at least one row. May be null |
connectionClosed | public void connectionClosed(ConnectionEvent event)(Code) | | This will be called if the Connection returned by the getConnection
method came from a PooledConnection, and the user calls the close()
method of this connection object. What we need to do here is to
release this PooledConnection from our pool...
|
connectionErrorOccurred | public void connectionErrorOccurred(ConnectionEvent event)(Code) | | If a fatal error occurs, close the underlying physical connection so as
not to be returned in the future
|
getPool | public KeyedObjectPool getPool()(Code) | | |
makeObject | public synchronized Object makeObject(Object key) throws Exception(Code) | | Parameters: key - throws: SQLException - if the connection could not be created. See Also: org.apache.commons.pool.KeyedPoolableObjectFactory.makeObject(java.lang.Object) |
setPool | public synchronized void setPool(KeyedObjectPool pool) throws SQLException(Code) | | Sets the {*link ObjectPool} in which to pool {*link Connection}s.
Parameters: pool - the {*link ObjectPool} in which to pool those {*link Connection}s |
setRollbackAfterValidation | public synchronized void setRollbackAfterValidation(boolean rollbackAfterValidation)(Code) | | Sets whether a rollback should be issued after
{*link #validateObject validating}
{*link Connection}s.
Parameters: rollbackAfterValidation - whether a rollback should be issued after{*link #validateObject validating} {*link Connection}s. |
setValidationQuery | public synchronized void setValidationQuery(String validationQuery)(Code) | | Sets the query I use to {*link #validateObject validate} {*link Connection}s.
Should return at least one row.
May be null
Parameters: validationQuery - a query to use to {*link #validateObject validate} {*link Connection}s. |
|
|