|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.ojb.broker.accesslayer.ConnectionFactoryAbstractImpl
Abstract base class to simplify implementation of ConnectionFactory
's.
Constructor Summary | |
ConnectionFactoryAbstractImpl()
|
Method Summary | |
abstract java.sql.Connection |
getConnectionFromPool(JdbcConnectionDescriptor jcd)
Implement this method. |
protected java.lang.String |
getDbURL(JdbcConnectionDescriptor jcd)
|
protected void |
initializeJdbcConnection(java.sql.Connection con,
JdbcConnectionDescriptor jcd)
Initialize the connection with the specified properties in OJB configuration files and platform depended properties. |
java.sql.Connection |
lookupConnection(JdbcConnectionDescriptor jcd)
Lookup a connection from the connection factory implementation. |
protected java.sql.Connection |
newConnectionFromDataSource(JdbcConnectionDescriptor jcd)
|
protected java.sql.Connection |
newConnectionFromDriverManager(JdbcConnectionDescriptor jcd)
Returns a new created connection |
void |
releaseAllResources()
Override this method to do cleanup in your implenetation. |
void |
releaseConnection(JdbcConnectionDescriptor jcd,
java.sql.Connection con)
Release connection - CAUTION: Release every connection after use to avoid abandoned connections. |
abstract void |
returnConnectionToPool(JdbcConnectionDescriptor jcd,
java.sql.Connection con)
Implement this method. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ConnectionFactoryAbstractImpl()
Method Detail |
public abstract java.sql.Connection getConnectionFromPool(JdbcConnectionDescriptor jcd) throws LookupException
LookupException
public abstract void returnConnectionToPool(JdbcConnectionDescriptor jcd, java.sql.Connection con) throws LookupException
LookupException
public void releaseConnection(JdbcConnectionDescriptor jcd, java.sql.Connection con)
ConnectionFactory
releaseConnection
in interface ConnectionFactory
public java.sql.Connection lookupConnection(JdbcConnectionDescriptor jcd) throws LookupException
ConnectionFactory
lookupConnection
in interface ConnectionFactory
LookupException
protected void initializeJdbcConnection(java.sql.Connection con, JdbcConnectionDescriptor jcd) throws LookupException
LookupException
PlatformFactory
,
Platform
public void releaseAllResources()
releaseAllResources
in interface ConnectionFactory
protected java.sql.Connection newConnectionFromDataSource(JdbcConnectionDescriptor jcd) throws LookupException
jcd
-
LookupException
- if we can't get a connection from the datasource either due to a
naming exception, a failed sanity check, or a SQLException.protected java.sql.Connection newConnectionFromDriverManager(JdbcConnectionDescriptor jcd) throws LookupException
jcd
- the connection descriptor
LookupException
protected java.lang.String getDbURL(JdbcConnectionDescriptor jcd)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |