deegree 2.5 (2011/06/29 09:44 build-8-official)

org.deegree.io
Class DBConnectionPool

java.lang.Object
  extended by org.deegree.io.DBConnectionPool

public class DBConnectionPool
extends java.lang.Object

class to manage a database connection pool. this is part of the combination of the object pool pattern an the singelton pattern.

Version:
07.02.2001
Author:
Andreas Poth

Method Summary
 java.sql.Connection acquireConnection(java.lang.String driver, java.lang.String database, java.util.Properties properties)
           
 java.sql.Connection acquireConnection(java.lang.String driver, java.lang.String database, java.lang.String user, java.lang.String password)
           
static DBConnectionPool getInstance()
          realize singelton pattern using double checked locking pattern.
 void releaseConnection(java.sql.Connection con, java.lang.String driver, java.lang.String database, java.util.Properties properties)
          releases a connection back to the pool
 void releaseConnection(java.sql.Connection con, java.lang.String driver, java.lang.String database, java.lang.String user, java.lang.String password)
          releases a connection back to the pool
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static DBConnectionPool getInstance()
realize singelton pattern using double checked locking pattern.

Returns:
an instance of the data base pool. it is gauranteed that there exists only one instance of pool for each submitted class name.

acquireConnection

public java.sql.Connection acquireConnection(java.lang.String driver,
                                             java.lang.String database,
                                             java.lang.String user,
                                             java.lang.String password)
                                      throws DBPoolException
Parameters:
driver - driver to look for
database - the database to open
user - the username
password - the password.
Returns:
get a Connection from the Connection pool
Throws:
DBPoolException

acquireConnection

public java.sql.Connection acquireConnection(java.lang.String driver,
                                             java.lang.String database,
                                             java.util.Properties properties)
                                      throws DBPoolException
Parameters:
driver - driver to look for
database - the database to open
properties - the properties of the database
Returns:
get a Connection from the Connection pool
Throws:
DBPoolException

releaseConnection

public void releaseConnection(java.sql.Connection con,
                              java.lang.String driver,
                              java.lang.String database,
                              java.lang.String user,
                              java.lang.String password)
                       throws DBPoolException
releases a connection back to the pool

Parameters:
con - connections to be released
driver - driver to look for
database - the database to open
user - the username
password - the password.
Throws:
DBPoolException

releaseConnection

public void releaseConnection(java.sql.Connection con,
                              java.lang.String driver,
                              java.lang.String database,
                              java.util.Properties properties)
                       throws java.lang.Exception
releases a connection back to the pool

Parameters:
con - connections to be released
driver - driver to look for
database - the database to open
properties - containing username and password.
Throws:
java.lang.Exception

deegree 2.5 (2011/06/29 09:44 build-8-official)

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org