Package org.quartz.utils
Class DBConnectionManager
- java.lang.Object
-
- org.quartz.utils.DBConnectionManager
-
public class DBConnectionManager extends java.lang.ObjectManages a collection of ConnectionProviders, and provides transparent access to their connections.
- Author:
- James House, Sharada Jambula, Mohammad Rezaei
- See Also:
ConnectionProvider,PoolingConnectionProvider,JNDIConnectionProvider
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringDB_PROPS_PREFIX
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddConnectionProvider(java.lang.String dataSourceName, ConnectionProvider provider)java.sql.ConnectiongetConnection(java.lang.String dsName)Get a database connection from the DataSource with the given name.static DBConnectionManagergetInstance()Get the class instance.voidshutdown(java.lang.String dsName)Shuts down database connections from the DataSource with the given name, if applicable for the underlying provider.
-
-
-
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.SQLExceptionGet 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.SQLExceptionShuts 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.
-
-