| java.lang.Object org.apache.ojb.broker.accesslayer.ConnectionFactoryAbstractImpl
All known Subclasses: org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl, org.apache.ojb.broker.accesslayer.ConnectionFactoryNotPooledImpl, org.apache.ojb.broker.accesslayer.ConnectionFactoryDBCPImpl,
ConnectionFactoryAbstractImpl | abstract public class ConnectionFactoryAbstractImpl implements ConnectionFactory(Code) | | Abstract base class to simplify implementation of
ConnectionFactory 's.
author: Armin Waibel version: $Id: ConnectionFactoryAbstractImpl.java,v 1.10.2.5 2005/04/30 20:55:15 mkalen Exp $ |
getJdbcProperties | protected Properties getJdbcProperties(JdbcConnectionDescriptor jcd, String user, String password)(Code) | | Returns connection properties for passing to DriverManager, after merging
JDBC driver-specific configuration settings with name/password from connection
descriptor.
Parameters: jcd - the connection descriptor with driver-specific settings Parameters: user - the jcd username (or null if not using authenticated login) Parameters: password - the jcd password (only used when user != null) merged properties object to pass to DriverManager |
newConnectionFromDataSource | protected Connection newConnectionFromDataSource(JdbcConnectionDescriptor jcd) throws LookupException(Code) | | Creates a new connection from the data source that the connection descriptor
represents. If the connection descriptor does not directly contain the data source
then a JNDI lookup is performed to retrieve the data source.
Parameters: jcd - The connection descriptor A connection instance throws: LookupException - if we can't get a connection from the datasource either due to anaming exception, a failed sanity check, or a SQLException. |
releaseAllResources | public synchronized void releaseAllResources()(Code) | | Override this method to do cleanup in your implementation.
Do a super.releaseAllResources() in your method implementation
to free resources used by this class.
|
releaseJdbcConnection | abstract public void releaseJdbcConnection(JdbcConnectionDescriptor jcd, Connection con) throws LookupException(Code) | | Releases a Connection after use. Implement this method in concrete subclasses.
Concrete implementations using Connection pooling are responsible for any validation
and pool removal management.
Note: This method is never called for a jdbc-connection-descriptor that uses datasources,
OJB only manages connections from DriverManager.
Parameters: jcd - the connection descriptor for which the connection was created Parameters: con - the connection to release.Callers must guarantee that the passed connection was obtained by callingConnectionFactoryAbstractImpl.checkOutJdbcConnection(org.apache.ojb.broker.metadata.JdbcConnectionDescriptor). throws: LookupException - if errors occured during release of object. Typically happensif return of object to pool fails in a pooled implementation. |
|
|