de.fhkl.zw.mkup.rattrap.db
Class DBPool

java.lang.Object
  extended by de.fhkl.zw.mkup.rattrap.db.DBPool

public class DBPool
extends java.lang.Object

a freely configurable connection pool for jdbc-capable databases

Author:
rob

Method Summary
 void closePool()
          closes all connections of this connection-pool and makes it ready for garbage collection
 void freeConnection(java.sql.Connection con)
          alters the used-state of a pool-connection from used to free and makes the connection available for other users
 java.sql.Connection getConnection()
          this method gets a reference to a free connection from the connectionpool
static DBPool getPool()
          this method returns a reference to the one and only database pool
 boolean isFree()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getPool

public static DBPool getPool()
this method returns a reference to the one and only database pool

Returns:
the reference to the database connection pool

getConnection

public java.sql.Connection getConnection()
                                  throws java.sql.SQLException
this method gets a reference to a free connection from the connectionpool

Returns:
a java.sql Connection object
Throws:
java.sql.SQLException - if there's no free exception left

freeConnection

public void freeConnection(java.sql.Connection con)
alters the used-state of a pool-connection from used to free and makes the connection available for other users

Parameters:
con - the connection that shall be freed

closePool

public void closePool()
closes all connections of this connection-pool and makes it ready for garbage collection


isFree

public boolean isFree()