public abstract class ConnectionMgr extends Object
| Constructor and Description |
|---|
ConnectionMgr(Log log,
PropertyMgr props)
Constructs a new ConnectionMgr.
|
ConnectionMgr(Log log,
PropertyMgr props,
String prefix)
Constructs a new ConnectionMgr.
|
ConnectionMgr(PropertyMgr props)
Delegates to
ConnectionMgr(Log, PropertyMgr) with logging to Log.getDefault(). |
ConnectionMgr(PropertyMgr props,
String prefix)
Delegates to
ConnectionMgr(Log, PropertyMgr) with logging to Log.getDefault()
and using the specified prefix for property names. |
ConnectionMgr(String jdbc_url,
String jdbc_driver,
String jdbc_user,
String jdbc_password,
String jdbc_catalog)
Creates a new ConnectionMgr with logging to
logging to
Log.getDefault(). |
| Modifier and Type | Method and Description |
|---|---|
boolean |
close()
Closes the ConnectionMgr.
|
Connection |
getConnection()
Returns a connection if successful, otherwise throws a
SQLException.
|
DBName |
getDBName()
Returns the dbname corresponding that the database connected to by this
connection manager.
|
Driver |
getDriver()
Returns the
Driver that this connection manager
is using to connect to the database. |
String |
getURL()
Returns the jdbc url that this connection manager is using,
|
void |
setCatalog(String name)
If set, the ConnectionMgr will always return connections
set to the specified catalog.
|
String |
toString() |
public ConnectionMgr(String jdbc_url, String jdbc_driver, String jdbc_user, String jdbc_password, String jdbc_catalog) throws Exception
Log.getDefault().jdbc.url - jdbc.driver - jdbc.user - jdbc.password - jdbc.catalog - optional, sets the default and can be
nullExceptionpublic ConnectionMgr(PropertyMgr props) throws Exception
ConnectionMgr(Log, PropertyMgr) with logging to Log.getDefault().Exceptionpublic ConnectionMgr(PropertyMgr props, String prefix) throws Exception
ConnectionMgr(Log, PropertyMgr) with logging to Log.getDefault()
and using the specified prefix for property names.Exceptionpublic ConnectionMgr(Log log, PropertyMgr props) throws Exception
fc.app.PropertyMgr.
Exceptionpublic ConnectionMgr(Log log, PropertyMgr props, String prefix) throws Exception
fc.app.PropertyMgr.
jdbc.urlbecomes:
prefixjdbc.urlThrows an Exception if this object cannot be constructed for some reason.
Exceptionpublic Driver getDriver()
Driver that this connection manager
is using to connect to the database.public DBName getDBName() throws SQLException
SQLExceptionpublic void setCatalog(String name)
public Connection getConnection() throws SQLException
SQLExceptionpublic boolean close()
handleMgrShutdown() method inside a
synchronized block.