org.apache.ojb.broker.accesslayer
Class ConnectionFactoryDBCPImpl

java.lang.Object
  extended byorg.apache.ojb.broker.accesslayer.ConnectionFactoryAbstractImpl
      extended byorg.apache.ojb.broker.accesslayer.ConnectionFactoryDBCPImpl
All Implemented Interfaces:
ConnectionFactory

public class ConnectionFactoryDBCPImpl
extends ConnectionFactoryAbstractImpl

ConnectionFactory implementation using Jakarta DBCP and Commons Pool to pool driver based connections. Based on a proposal of Dirk Verbeek - Thanks.

Version:
$Id: ConnectionFactoryDBCPImpl.java,v 1.10.2.1 2005/03/16 17:51:18 mkalen Exp $
Author:
Armin Waibel

Constructor Summary
ConnectionFactoryDBCPImpl()
           
 
Method Summary
 java.sql.Connection getConnectionFromPool(JdbcConnectionDescriptor jcd)
          Implement this method.
 void releaseAllResources()
          Closes all managed pools.
 void returnConnectionToPool(JdbcConnectionDescriptor jcd, java.sql.Connection con)
          Implement this method.
 
Methods inherited from class org.apache.ojb.broker.accesslayer.ConnectionFactoryAbstractImpl
lookupConnection, releaseConnection
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConnectionFactoryDBCPImpl

public ConnectionFactoryDBCPImpl()
Method Detail

getConnectionFromPool

public java.sql.Connection getConnectionFromPool(JdbcConnectionDescriptor jcd)
                                          throws LookupException
Description copied from class: ConnectionFactoryAbstractImpl
Implement this method. This method was called to obtain a jdbc-connection from the pool.
Note: This method was not called, if jdbc-connection-descriptor use datasources - OJB only pool connections from DriverManager.

Specified by:
getConnectionFromPool in class ConnectionFactoryAbstractImpl
Throws:
LookupException

returnConnectionToPool

public void returnConnectionToPool(JdbcConnectionDescriptor jcd,
                                   java.sql.Connection con)
                            throws LookupException
Description copied from class: ConnectionFactoryAbstractImpl
Implement this method. Was called to return a connection to pool.
Note: This method was not called, if the jdbc-connection-descriptor uses datasources - OJB only pool connections from DriverManager.

Specified by:
returnConnectionToPool in class ConnectionFactoryAbstractImpl
Throws:
LookupException

releaseAllResources

public void releaseAllResources()
Closes all managed pools.

Specified by:
releaseAllResources in interface ConnectionFactory
Overrides:
releaseAllResources in class ConnectionFactoryAbstractImpl


(C) 2002 - 2004 Apache Software Foundation
All rights reserved. Published under the Apache License 2.0.
http://db.apache.org/ojb
Version: 1.0.3, 2005-04-2