edu.mssm.crover.scentral
Class ConnectionPool

java.lang.Object
  |
  +--edu.mssm.crover.scentral.ConnectionPool

public class ConnectionPool
extends java.lang.Object


Constructor Summary
protected ConnectionPool(java.lang.String dbURL, java.lang.String user, java.lang.String password, java.lang.String driverClassName, int minConnections, int maxConnections, Log log)
          Constructs a connection pool.
 
Method Summary
protected  void checkActive()
           
 void deactivate()
          Force the finalization and flag this object as inactive.
protected  void finalize()
           
protected  java.sql.Connection getConnection()
           
protected  void returnConnection(java.sql.Connection returned)
           
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConnectionPool

protected ConnectionPool(java.lang.String dbURL,
                         java.lang.String user,
                         java.lang.String password,
                         java.lang.String driverClassName,
                         int minConnections,
                         int maxConnections,
                         Log log)
                  throws java.sql.SQLException,
                         java.lang.ClassNotFoundException
Constructs a connection pool. Makes sure only one is active at one time in a ClassLoader context. When a new connection pool is created, all the instances created before it are deactivated. Upon deactivation, instances close their connections with the database and so cannot be used anymore. Any attempt to use a deactivated connection pool results in an internal error.

Method Detail

deactivate

public void deactivate()
Force the finalization and flag this object as inactive. This instance closes its connections with the database and so cannot be used anymore. Any attempt to use this instance, after calling this method, results in an internal error (a FATAL diagnostic message is logged).


getConnection

protected java.sql.Connection getConnection()
                                     throws java.sql.SQLException
java.sql.SQLException

checkActive

protected void checkActive()

returnConnection

protected void returnConnection(java.sql.Connection returned)

finalize

protected void finalize()
                 throws java.lang.Throwable
Overrides:
finalize in class java.lang.Object
java.lang.Throwable


Copyright @ 2003 Mount Sinai School of Medicine. All Rights Reserved.