dataConnection
Class DataConnection

java.lang.Object
  extended by dataConnection.DataConnection

public class DataConnection
extends java.lang.Object

DataConnection gets and disconnects connections to the database.

Author:
02leungi

Constructor Summary
DataConnection()
           
 
Method Summary
static java.sql.Connection connect(boolean useEnvironment)
          Get a database connection using the connection pool or through a DriverManager depending on the value of 'useEnvironment'.
static void disconnect(java.sql.Connection conn)
          Close the database connection (actually returns the connection object to the connection pool).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataConnection

public DataConnection()
Method Detail

connect

public static java.sql.Connection connect(boolean useEnvironment)
Get a database connection using the connection pool or through a DriverManager depending on the value of 'useEnvironment'.

Parameters:
useEnvironment - If true, J2EE environment will be used to acquire database connection. If false, using a DriverManager to acquire database connection.
Returns:
A connection to the database.

disconnect

public static void disconnect(java.sql.Connection conn)
Close the database connection (actually returns the connection object to the connection pool).

Parameters:
conn - The database connection to close.