|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.apache.commons.dbcp.PoolableConnectionFactory
A PoolableObjectFactory that creates
PoolableConnections.
| Field Summary | |
protected AbandonedConfig |
_config
Deprecated. AbandonedConfig is now deprecated. |
protected ConnectionFactory |
_connFactory
|
protected boolean |
_defaultAutoCommit
|
protected String |
_defaultCatalog
|
protected Boolean |
_defaultReadOnly
|
protected int |
_defaultTransactionIsolation
|
protected ObjectPool |
_pool
|
protected KeyedObjectPoolFactory |
_stmtPoolFactory
|
protected String |
_validationQuery
|
| Constructor Summary | |
PoolableConnectionFactory(ConnectionFactory connFactory,
ObjectPool pool,
KeyedObjectPoolFactory stmtPoolFactory,
String validationQuery,
boolean defaultReadOnly,
boolean defaultAutoCommit)
Create a new PoolableConnectionFactory. |
|
PoolableConnectionFactory(ConnectionFactory connFactory,
ObjectPool pool,
KeyedObjectPoolFactory stmtPoolFactory,
String validationQuery,
boolean defaultReadOnly,
boolean defaultAutoCommit,
AbandonedConfig config)
Deprecated. AbandonedConfig is now deprecated. |
|
PoolableConnectionFactory(ConnectionFactory connFactory,
ObjectPool pool,
KeyedObjectPoolFactory stmtPoolFactory,
String validationQuery,
boolean defaultReadOnly,
boolean defaultAutoCommit,
int defaultTransactionIsolation)
Create a new PoolableConnectionFactory. |
|
PoolableConnectionFactory(ConnectionFactory connFactory,
ObjectPool pool,
KeyedObjectPoolFactory stmtPoolFactory,
String validationQuery,
boolean defaultReadOnly,
boolean defaultAutoCommit,
int defaultTransactionIsolation,
AbandonedConfig config)
Deprecated. AbandonedConfig is now deprecated. |
|
PoolableConnectionFactory(ConnectionFactory connFactory,
ObjectPool pool,
KeyedObjectPoolFactory stmtPoolFactory,
String validationQuery,
boolean defaultReadOnly,
boolean defaultAutoCommit,
int defaultTransactionIsolation,
String defaultCatalog,
AbandonedConfig config)
Deprecated. AbandonedConfig is now deprecated. |
|
PoolableConnectionFactory(ConnectionFactory connFactory,
ObjectPool pool,
KeyedObjectPoolFactory stmtPoolFactory,
String validationQuery,
Boolean defaultReadOnly,
boolean defaultAutoCommit,
int defaultTransactionIsolation,
String defaultCatalog,
AbandonedConfig config)
Create a new PoolableConnectionFactory. |
|
| Method Summary | |
void |
activateObject(Object obj)
|
void |
destroyObject(Object obj)
|
ObjectPool |
getPool()
|
Object |
makeObject()
|
void |
passivateObject(Object obj)
|
void |
setConnectionFactory(ConnectionFactory connFactory)
Sets the ConnectionFactory from which to obtain base Connections. |
void |
setDefaultAutoCommit(boolean defaultAutoCommit)
Sets the default "auto commit" setting for borrowed Connections |
void |
setDefaultCatalog(String defaultCatalog)
Sets the default "catalog" setting for borrowed Connections |
void |
setDefaultReadOnly(boolean defaultReadOnly)
Sets the default "read only" setting for borrowed Connections |
void |
setDefaultTransactionIsolation(int defaultTransactionIsolation)
Sets the default "Transaction Isolation" setting for borrowed Connections |
void |
setPool(ObjectPool pool)
Sets the ObjectPool in which to pool Connections. |
void |
setStatementPoolFactory(KeyedObjectPoolFactory stmtPoolFactory)
Sets the KeyedObjectPoolFactory I use to create KeyedObjectPools
for pooling PreparedStatements. |
void |
setValidationQuery(String validationQuery)
Sets the query I use to validate Connections. |
void |
validateConnection(Connection conn)
|
boolean |
validateObject(Object obj)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected ConnectionFactory _connFactory
protected String _validationQuery
protected ObjectPool _pool
protected KeyedObjectPoolFactory _stmtPoolFactory
protected Boolean _defaultReadOnly
protected boolean _defaultAutoCommit
protected int _defaultTransactionIsolation
protected String _defaultCatalog
protected AbandonedConfig _config
| Constructor Detail |
public PoolableConnectionFactory(ConnectionFactory connFactory,
ObjectPool pool,
KeyedObjectPoolFactory stmtPoolFactory,
String validationQuery,
boolean defaultReadOnly,
boolean defaultAutoCommit)
connFactory - the ConnectionFactory from which to obtain base Connectionspool - the ObjectPool in which to pool those ConnectionsstmtPoolFactory - the KeyedObjectPoolFactory to use to create KeyedObjectPools for pooling PreparedStatements, or null to disable PreparedStatement poolingvalidationQuery - a query to use to validate Connections. Should return at least one row. Using null turns off validation.defaultReadOnly - the default "read only" setting for borrowed ConnectionsdefaultAutoCommit - the default "auto commit" setting for returned Connections
public PoolableConnectionFactory(ConnectionFactory connFactory,
ObjectPool pool,
KeyedObjectPoolFactory stmtPoolFactory,
String validationQuery,
boolean defaultReadOnly,
boolean defaultAutoCommit,
int defaultTransactionIsolation)
connFactory - the ConnectionFactory from which to obtain base Connectionspool - the ObjectPool in which to pool those ConnectionsstmtPoolFactory - the KeyedObjectPoolFactory to use to create KeyedObjectPools for pooling PreparedStatements, or null to disable PreparedStatement poolingvalidationQuery - a query to use to validate Connections. Should return at least one row. Using null turns off validation.defaultReadOnly - the default "read only" setting for borrowed ConnectionsdefaultAutoCommit - the default "auto commit" setting for returned ConnectionsdefaultTransactionIsolation - the default "Transaction Isolation" setting for returned Connections
public PoolableConnectionFactory(ConnectionFactory connFactory,
ObjectPool pool,
KeyedObjectPoolFactory stmtPoolFactory,
String validationQuery,
boolean defaultReadOnly,
boolean defaultAutoCommit,
AbandonedConfig config)
connFactory - the ConnectionFactory from which to obtain base Connectionspool - the ObjectPool in which to pool those ConnectionsstmtPoolFactory - the KeyedObjectPoolFactory to use to create KeyedObjectPools for pooling PreparedStatements, or null to disable PreparedStatement poolingvalidationQuery - a query to use to validate Connections. Should return at least one row. Using null turns off validation.defaultReadOnly - the default "read only" setting for borrowed ConnectionsdefaultAutoCommit - the default "auto commit" setting for returned Connectionsconfig - the AbandonedConfig if tracing SQL objects
public PoolableConnectionFactory(ConnectionFactory connFactory,
ObjectPool pool,
KeyedObjectPoolFactory stmtPoolFactory,
String validationQuery,
boolean defaultReadOnly,
boolean defaultAutoCommit,
int defaultTransactionIsolation,
AbandonedConfig config)
connFactory - the ConnectionFactory from which to obtain base Connectionspool - the ObjectPool in which to pool those ConnectionsstmtPoolFactory - the KeyedObjectPoolFactory to use to create KeyedObjectPools for pooling PreparedStatements, or null to disable PreparedStatement poolingvalidationQuery - a query to use to validate Connections. Should return at least one row. Using null turns off validation.defaultReadOnly - the default "read only" setting for borrowed ConnectionsdefaultAutoCommit - the default "auto commit" setting for returned ConnectionsdefaultTransactionIsolation - the default "Transaction Isolation" setting for returned Connectionsconfig - the AbandonedConfig if tracing SQL objects
public PoolableConnectionFactory(ConnectionFactory connFactory,
ObjectPool pool,
KeyedObjectPoolFactory stmtPoolFactory,
String validationQuery,
boolean defaultReadOnly,
boolean defaultAutoCommit,
int defaultTransactionIsolation,
String defaultCatalog,
AbandonedConfig config)
connFactory - the ConnectionFactory from which to obtain base Connectionspool - the ObjectPool in which to pool those ConnectionsstmtPoolFactory - the KeyedObjectPoolFactory to use to create KeyedObjectPools for pooling PreparedStatements, or null to disable PreparedStatement poolingvalidationQuery - a query to use to validate Connections. Should return at least one row. Using null turns off validation.defaultReadOnly - the default "read only" setting for borrowed ConnectionsdefaultAutoCommit - the default "auto commit" setting for returned ConnectionsdefaultTransactionIsolation - the default "Transaction Isolation" setting for returned ConnectionsdefaultCatalog - the default "catalog" setting for returned Connectionsconfig - the AbandonedConfig if tracing SQL objects
public PoolableConnectionFactory(ConnectionFactory connFactory,
ObjectPool pool,
KeyedObjectPoolFactory stmtPoolFactory,
String validationQuery,
Boolean defaultReadOnly,
boolean defaultAutoCommit,
int defaultTransactionIsolation,
String defaultCatalog,
AbandonedConfig config)
connFactory - the ConnectionFactory from which to obtain base Connectionspool - the ObjectPool in which to pool those ConnectionsstmtPoolFactory - the KeyedObjectPoolFactory to use to create KeyedObjectPools for pooling PreparedStatements, or null to disable PreparedStatement poolingvalidationQuery - a query to use to validate Connections. Should return at least one row. Using null turns off validation.defaultReadOnly - the default "read only" setting for borrowed ConnectionsdefaultAutoCommit - the default "auto commit" setting for returned ConnectionsdefaultTransactionIsolation - the default "Transaction Isolation" setting for returned ConnectionsdefaultCatalog - the default "catalog" setting for returned Connectionsconfig - the AbandonedConfig if tracing SQL objects| Method Detail |
public void setConnectionFactory(ConnectionFactory connFactory)
ConnectionFactory from which to obtain base Connections.
connFactory - the ConnectionFactory from which to obtain base Connectionspublic void setValidationQuery(String validationQuery)
validate Connections.
Should return at least one row.
Using null turns off validation.
validationQuery - a query to use to validate Connections.public void setPool(ObjectPool pool)
ObjectPool in which to pool Connections.
pool - the ObjectPool in which to pool those Connectionspublic ObjectPool getPool()
public void setStatementPoolFactory(KeyedObjectPoolFactory stmtPoolFactory)
KeyedObjectPoolFactory I use to create KeyedObjectPools
for pooling PreparedStatements.
Set to null to disable PreparedStatement pooling.
stmtPoolFactory - the KeyedObjectPoolFactory to use to create KeyedObjectPools for pooling PreparedStatementspublic void setDefaultReadOnly(boolean defaultReadOnly)
Connections
defaultReadOnly - the default "read only" setting for borrowed Connectionspublic void setDefaultAutoCommit(boolean defaultAutoCommit)
Connections
defaultAutoCommit - the default "auto commit" setting for borrowed Connectionspublic void setDefaultTransactionIsolation(int defaultTransactionIsolation)
Connections
defaultTransactionIsolation - the default "Transaction Isolation" setting for returned Connectionspublic void setDefaultCatalog(String defaultCatalog)
Connections
defaultCatalog - the default "catalog" setting for borrowed Connections
public Object makeObject()
throws Exception
makeObject in interface PoolableObjectFactoryException
public void destroyObject(Object obj)
throws Exception
destroyObject in interface PoolableObjectFactoryExceptionpublic boolean validateObject(Object obj)
validateObject in interface PoolableObjectFactory
public void validateConnection(Connection conn)
throws SQLException
SQLException
public void passivateObject(Object obj)
throws Exception
passivateObject in interface PoolableObjectFactoryException
public void activateObject(Object obj)
throws Exception
activateObject in interface PoolableObjectFactoryException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||