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 |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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 holdersizeOfPool
- The number of connections to create- Throws:
java.sql.SQLException
- If a SQLException was thrownjava.lang.ClassNotFoundException
- If the driver could not be loaded into
memoryjava.lang.InstantiationException
- If the driver could not be foundjava.lang.IllegalAccessException
- If the access to the DB could NOT be accessed
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