org.quartz.utils
Class DBConnectionManager

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

public class DBConnectionManager
extends 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 String DB_PROPS_PREFIX
           
 
Method Summary
 void addConnectionProvider(String dataSourceName, ConnectionProvider provider)
           
 Connection getConnection(String dsName)
          Get a database connection from the DataSource with the given name.
static DBConnectionManager getInstance()
          Get the class instance.
 void shutdown(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 String DB_PROPS_PREFIX
See Also:
Constant Field Values
Method Detail

addConnectionProvider

public void addConnectionProvider(String dataSourceName,
                                  ConnectionProvider provider)

getConnection

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

Returns:
a database connection
Throws:
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(String dsName)
              throws SQLException
Shuts down database connections from the DataSource with the given name, if applicable for the underlying provider.

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


Copyright 2001-2015, Terracotta, Inc.