|
Oracle Personalization REAPI_RT v9.0.2 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--oracle.dmt.op.re.reapi.rt.DBConnectionManager
This class is a singleton that provides access to one or many
connection pools defined in a property file. A client gets
access to the single instance through the static getInstance()
method and can then check out and check in connections from a pool.
When the client shuts down it should call the release() method
to close all open connections and do other clean-up.
| Method Summary |
| Type | Method |
|---|---|
void |
addPool(String poolName,
String dbURL,
String user,
String passWd,
int maxConn)
Creates an instance of DBConnectionPool. |
void |
freeConnection(String name,
Connection con)
Returns a connection to the named pool. |
Connection |
getConnection(String name)
Returns an open connection. |
Connection |
getConnection(String name,
long time)
Returns an open connection. |
int |
getFreeConn(String name)
|
static DBConnectionManager |
getInstance()
Returns the single instance, creating one if it's the first time this method is called. |
int |
getOpenConn(String name)
|
void |
release()
Closes all open connections and deregisters all drivers. |
void |
removePool(String poolName)
Removes an instance of DBConnectionPool. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode,
notify, notifyAll, toString,
wait, wait, wait |
| Method Detail |
public static DBConnectionManager getInstance()
public void freeConnection(String name,
Connection con)
name - the pool name as defined in the properties filecon - the connection
public Connection getConnection(String name)
throws ConnectionPoolIsFullException
name - the pool name as defined in the properties filepublic int getOpenConn(String name)
public int getFreeConn(String name)
public Connection getConnection(String name,
long time)
throws ConnectionPoolIsFullException
name - the pool name as defined in the properties filetime - the number of milliseconds to wait
public void release()
throws SQLException
public void addPool(String poolName,
String dbURL,
String user,
String passWd,
int maxConn)
DBConnectionPool.
A DBConnectionPool can be defined with the following
attributes:
<poolname>.dbURL the JDBC URL for the database
<poolname>.user a database user (optional)
<poolname>.password a database user password (if user-specified)
<poolname>.maxconn the maximum number of connections (optional)
poolName - the name of the connection pooldbURL - the JDBC URL for the databaseuser - the user namepassword - the passwordmaxConn - the maximum number
of connections allowedpublic void removePool(String poolName)
DBConnectionPool.poolName, - the name of the connection pool
|
Oracle Personalization REAPI_RT v9.0.2 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||