|
OracleAS Personalization Java API Reference 10g Release 2 (10.1.2) B14053-01 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.dmt.op.re.reapi.rt.DBConnectionManager
This is a singleton class that provides access to one or many connection pools. For REAPI_RT internal use only.
Method Summary | |
void |
addPool(java.lang.String poolName, java.lang.String dbURL, java.lang.String user, java.lang.String passWd, int maxConn) Creates an instance of DBConnectionPool . |
void |
addPool(java.lang.String poolName, java.lang.String dbURL, java.lang.String user, java.lang.String passWd, int maxConn, int timeout) Creates an instance of DBConnectionPool with the ability to closed idle connection after a specified period. |
void |
freeConnection(java.lang.String name, java.sql.Connection con) Returns a connection to the named pool when it is freed. |
java.sql.Connection |
getConnection(java.lang.String name) Returns an open connection. |
java.sql.Connection |
getConnection(java.lang.String name, long time) Returns an open connection from the named pool. |
static DBConnectionManager |
getInstance(int nTrace) Returns the single instance, creating one if it's the first time this method is called. |
int |
getNumberOfFreeConnections(java.lang.String name) Returns number of free connections in the named pool. |
int |
getNumberOfOpenConnections(java.lang.String name) Returns number of open connections in the named pool. |
void |
release() Closes all open connections and deregisters JDBC drivers. |
void |
removePool(java.lang.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(int nTrace)
public void freeConnection(java.lang.String name, java.sql.Connection con)
name
- the pool name as defined in the properties filecon
- the connectionpublic java.sql.Connection getConnection(java.lang.String name) throws ConnectionPoolIsFullException
name
- the pool nameConnectionPoolIsFullException
public java.sql.Connection getConnection(java.lang.String name, long time) throws ConnectionPoolIsFullException
name
- the pool nametime
- the number of milliseconds to waitConnectionPoolIsFullException
public int getNumberOfOpenConnections(java.lang.String name)
name
- the pool namepublic int getNumberOfFreeConnections(java.lang.String name)
name
- the pool namepublic void release() throws java.sql.SQLException
java.sql.SQLException
public void addPool(java.lang.String poolName, java.lang.String dbURL, java.lang.String user, java.lang.String passWd, int maxConn)
DBConnectionPool
. A DBConnectionPool
can be defined with the following attributes:
<poolname>.dbURL the JDBC URL for the database <poolname>.user user name (optional) <poolname>.password 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 namemaxConn
- the maximum number of connections allowedpublic void addPool(java.lang.String poolName, java.lang.String dbURL, java.lang.String user, java.lang.String passWd, int maxConn, int timeout)
DBConnectionPool
with the ability to closed idle connection after a specified period. A DBConnectionPool
can be defined with the following attributes:
<poolname>.dbURL the JDBC URL for the database <poolname>.user user name (optional) <poolname>.password password (if user-specified) <poolname>.maxconn the maximum number of connections (optional) <poolname>.timeout idle time allowed for connections, in seconds
poolName
- the name of the connection pooldbURL
- the JDBC URL for the databaseuser
- the user namemaxConn
- the maximum number of connections allowedtimeout
- idle time allowed for open connections, in secondspublic void removePool(java.lang.String poolName)
DBConnectionPool
.
|
OracleAS Personalization Java API Reference 10g Release 2 (10.1.2) B14053-01 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |