com.peter.db
Class DBConPool

java.lang.Object
  |
  +--com.peter.db.DBConPool

public class DBConPool
extends java.lang.Object

This class handles a pool of database connections

Version:
$Revision: 1.0.1, 2003-11-04 $
Author:
Peter Larsson

Constructor Summary
DBConPool(java.util.Properties props, int sizeOfPool)
          Constructor for the a new object
 
Method Summary
 void closeConnections()
          Closes all database connections managed by this pool
 DBConHandler getHandler()
          Returns a DB connection handler
 void releaseHandler(DBConHandler handler)
          Releases a handler and returns it to the pool of free handlers
 void replaceHandler(DBConHandler handler)
          Replaces a handler that was forced to be released.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DBConPool

public DBConPool(java.util.Properties props,
                 int sizeOfPool)
          throws java.sql.SQLException,
                 java.lang.ClassNotFoundException,
                 java.lang.InstantiationException,
                 java.lang.IllegalAccessException
Constructor for the a new object
Parameters:
props - Database configuration holder
sizeOfPool - The number of connections to create
Throws:
java.sql.SQLException - If a SQLException was thrown
java.lang.ClassNotFoundException - If the driver could not be loaded into memory
java.lang.InstantiationException - If the driver could not be found
java.lang.IllegalAccessException - If the access to the DB could NOT be accessed
Method Detail

getHandler

public DBConHandler getHandler()
Returns a DB connection handler
Returns:
A DB connection handler

releaseHandler

public void releaseHandler(DBConHandler handler)
Releases a handler and returns it to the pool of free handlers
Parameters:
handler - The handler to release

replaceHandler

public void replaceHandler(DBConHandler handler)
Replaces a handler that was forced to be released.
Parameters:
handler - The handler to replace.

closeConnections

public void closeConnections()
Closes all database connections managed by this pool