com.rhi.architecture.db
Class PoolingDataSource

java.lang.Object
  extended byorg.apache.commons.dbcp.PoolingDataSource
      extended bycom.rhi.architecture.db.PoolingDataSource
All Implemented Interfaces:
javax.sql.DataSource

public class PoolingDataSource
extends org.apache.commons.dbcp.PoolingDataSource

Extends DBCP PoolingDataSource, providing a get method for the connection pool. This allows the DataSourceFactory to get the connection pool back & call close() on it to free all the connections.

Since:
1.0
Author:
Pete McKinstry

Field Summary
 
Fields inherited from class org.apache.commons.dbcp.PoolingDataSource
_logWriter, _pool
 
Constructor Summary
PoolingDataSource(org.apache.commons.pool.ObjectPool pool)
          Constructor
 
Method Summary
 java.sql.Connection getConnection()
          helper method
 org.apache.commons.pool.ObjectPool getPool()
          Return the connection pool that this datasource fronts.
 Logger log()
          log() helper method
 void logCurrentDetails()
          log details about data source.
 
Methods inherited from class org.apache.commons.dbcp.PoolingDataSource
getConnection, getLoginTimeout, getLogWriter, setLoginTimeout, setLogWriter, setPool
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PoolingDataSource

public PoolingDataSource(org.apache.commons.pool.ObjectPool pool)
Constructor

Parameters:
pool - Pool from which Connections will be retrieved.
Since:
1.0
Method Detail

getPool

public org.apache.commons.pool.ObjectPool getPool()
Return the connection pool that this datasource fronts. This is required to allow the DataSourceFactory to properly shut down the connection pool on application shutdown.

Returns:
ObjectPool
Since:
1.0

logCurrentDetails

public void logCurrentDetails()
log details about data source.


log

public Logger log()
log() helper method

Returns:
Logger

getConnection

public java.sql.Connection getConnection()
                                  throws java.sql.SQLException
helper method

Returns:
Connection
Throws:
java.sql.SQLException
See Also:
DataSource.getConnection()


Copyright © 2002-2004 Robert Half International. All Rights Reserved.