org.quartz.utils
Class DBConnectionManager

java.lang.Object
  extended by org.quartz.utils.DBConnectionManager

public class DBConnectionManager
extends java.lang.Object

Manages a collection of ConnectionProviders, and provides transparent access to their connections.

Author:
James House, Sharada Jambula, Mohammad Rezaei
See Also:
ConnectionProvider, PoolingConnectionProvider, JNDIConnectionProvider, WeblogicConnectionProvider

Field Summary
static java.lang.String DB_PROPS_PREFIX
           
 
Method Summary
 void addConnectionProvider(java.lang.String dataSourceName, ConnectionProvider provider)
           
 java.sql.Connection getConnection(java.lang.String dsName)
          Get a database connection from the DataSource with the given name.
static DBConnectionManager getInstance()
          Get the class instance.
 void shutdown(java.lang.String dsName)
          Shuts down database connections from the DataSource with the given name, if applicable for the underlying provider.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DB_PROPS_PREFIX

public static final java.lang.String DB_PROPS_PREFIX
See Also:
Constant Field Values
Method Detail

addConnectionProvider

public void addConnectionProvider(java.lang.String dataSourceName,
                                  ConnectionProvider provider)

getConnection

public java.sql.Connection getConnection(java.lang.String dsName)
                                  throws java.sql.SQLException
Get a database connection from the DataSource with the given name.

Returns:
a database connection
Throws:
java.sql.SQLException - if an error occurs, or there is no DataSource with the given name.

getInstance

public static DBConnectionManager getInstance()
Get the class instance.

Returns:
an instance of this class

shutdown

public void shutdown(java.lang.String dsName)
              throws java.sql.SQLException
Shuts down database connections from the DataSource with the given name, if applicable for the underlying provider.

Throws:
java.sql.SQLException - if an error occurs, or there is no DataSource with the given name.


Copyright 2001-2011, Terracotta, Inc.