public abstract class ConnectionMgr extends java.lang.Object
Constructor and Description |
---|
ConnectionMgr(Log log,
PropertyMgr props)
Constructs a new ConnectionMgr.
|
ConnectionMgr(Log log,
PropertyMgr props,
java.lang.String prefix)
Constructs a new ConnectionMgr.
|
ConnectionMgr(PropertyMgr props)
Delegates to
ConnectionMgr(Log, PropertyMgr) with logging to Log.getDefault() . |
ConnectionMgr(PropertyMgr props,
java.lang.String prefix)
Delegates to
ConnectionMgr(Log, PropertyMgr) with logging to Log.getDefault()
and using the specified prefix for property names. |
ConnectionMgr(java.lang.String jdbc_url,
java.lang.String jdbc_driver,
java.lang.String jdbc_user,
java.lang.String jdbc_password,
java.lang.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.
|
java.sql.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.
|
java.sql.Driver |
getDriver()
Returns the
Driver that this connection manager
is using to connect to the database. |
java.lang.String |
getURL()
Returns the jdbc url that this connection manager is using,
|
void |
setCatalog(java.lang.String name)
If set, the ConnectionMgr will always return connections
set to the specified catalog.
|
java.lang.String |
toString() |
public ConnectionMgr(java.lang.String jdbc_url, java.lang.String jdbc_driver, java.lang.String jdbc_user, java.lang.String jdbc_password, java.lang.String jdbc_catalog) throws java.lang.Exception
Log.getDefault()
.jdbc.url
- jdbc.driver
- jdbc.user
- jdbc.password
- jdbc.catalog
- optional, sets the default and can be
nulljava.lang.Exception
public ConnectionMgr(PropertyMgr props) throws java.lang.Exception
ConnectionMgr(Log, PropertyMgr)
with logging to Log.getDefault()
.java.lang.Exception
public ConnectionMgr(PropertyMgr props, java.lang.String prefix) throws java.lang.Exception
ConnectionMgr(Log, PropertyMgr)
with logging to Log.getDefault()
and using the specified prefix for property names.java.lang.Exception
public ConnectionMgr(Log log, PropertyMgr props) throws java.lang.Exception
fc.app.PropertyMgr
.
java.lang.Exception
public ConnectionMgr(Log log, PropertyMgr props, java.lang.String prefix) throws java.lang.Exception
fc.app.PropertyMgr
.
jdbc.urlbecomes:
prefixjdbc.urlThrows an Exception if this object cannot be constructed for some reason.
java.lang.Exception
public java.sql.Driver getDriver()
Driver
that this connection manager
is using to connect to the database.public DBName getDBName() throws java.sql.SQLException
java.sql.SQLException
public void setCatalog(java.lang.String name)
public java.sql.Connection getConnection() throws java.sql.SQLException
java.sql.SQLException
public boolean close()
handleMgrShutdown()
method inside a
synchronized block.public java.lang.String getURL()
public java.lang.String toString()
toString
in class java.lang.Object