|
Business Components | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Declares ConnectionPoolManager operations. If JDBC connection pooling has been enabled, the ConnectionPoolManager is invoked by the BC4J database transaction class to manage cached JDBC connection instances. The following guidelines should be followed when implementing a custom ConnectionPoolManager:
The connection pool manager should be able to support multiple database instance, user, and password combinations. For more information see {link #generatePoolKey generatePoolKey}.
Method Summary | |
void |
addConnection(java.lang.String poolKey,
java.sql.Connection connection)
Add a connection to a connection pool. |
java.lang.String |
generatePoolKey(java.lang.String url,
java.util.Properties info)
Generate a unique pool identifier for the specified JDBC URL and JDBC driver properties. |
java.lang.String |
generatePoolKey(java.lang.String url,
java.lang.String user,
java.lang.String password)
Generate a unique pool identifier for the specified JDBC URL and JDBC driver properties. |
java.sql.Connection |
getConnection(java.lang.String connectionPoolKey,
java.lang.String url,
java.util.Properties info,
java.lang.String user,
java.lang.String password)
Get a pooled connection from the specified target pool. |
int |
getInitPoolSize()
Return the initial pool size for connection pools that are managed by this connection pool manager. |
int |
getMaxPoolSize()
Return the maximum pool size for connection pools that are managed by this connection pool manager. |
void |
removeConnection(java.lang.String poolKey,
java.sql.Connection connection)
Remove a pooled connection from a connection pool. |
void |
returnConnection(java.lang.String poolKey,
java.sql.Connection connection)
Return a pooled connection to a connection pool. |
Method Detail |
public java.sql.Connection getConnection(java.lang.String connectionPoolKey, java.lang.String url, java.util.Properties info, java.lang.String user, java.lang.String password)
public void returnConnection(java.lang.String poolKey, java.sql.Connection connection)
The implementation of this operation should ensure that the returned connection that does in fact belong to the specified connection pool.
poolKey
- A unique identifier for the target connection pool.connection
- The connection that should be checked in.public void addConnection(java.lang.String poolKey, java.sql.Connection connection)
The implementation of this method should not return the connection to the pool after the connection has been added because the invoking object still holds a reference to that connection. Instead, it is recommended that returning the new connection be the responsibility of of the object that owns the initial reference to the connection.
poolKey
- A unique identifier for the target connection pool.connection
- The connection that should be checked in.public void removeConnection(java.lang.String poolKey, java.sql.Connection connection)
poolKey
- A unique identifier for the target connection pool.connection
- The connection that should be checked in.public java.lang.String generatePoolKey(java.lang.String url, java.util.Properties info)
url
- The JDBC url that will be used to create connections in this
pool.info
- The JDBC properties that will be used to create connections
in this pool.public java.lang.String generatePoolKey(java.lang.String url, java.lang.String user, java.lang.String password)
url
- The JDBC url that will be used to create connections in this
pool.user
- The user that will be used for database authenticationpassword
- The password that will be used for database authenticationpublic int getMaxPoolSize()
public int getInitPoolSize()
|
Business Components | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |