public class DBConnectionManager extends Object
Manages a collection of ConnectionProviders, and provides transparent access to their connections.
ConnectionProvider,
PoolingConnectionProvider,
JNDIConnectionProvider,
WeblogicConnectionProvider| Modifier and Type | Field and Description |
|---|---|
static String |
DB_PROPS_PREFIX |
| Modifier and Type | Method and Description |
|---|---|
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.
|
public static final String DB_PROPS_PREFIX
public void addConnectionProvider(String dataSourceName, ConnectionProvider provider)
public Connection getConnection(String dsName) throws SQLException
SQLException - if an error occurs, or there is no DataSource with the
given name.public static DBConnectionManager getInstance()
public void shutdown(String dsName) throws SQLException
SQLException - if an error occurs, or there is no DataSource with the
given name.Copyright 2001-2019, Terracotta, Inc.