Package org.eclnt.ccee.db.dofw
Class DBConnectionPool
java.lang.Object
org.eclnt.ccee.db.dofw.DBConnectionPool
- All Implemented Interfaces:
ICCEEConstants
Simple connection pool implementation.
Connections are pooled per context name and tenant by default.
Connections are rolled back when added to the pool - and the are checked before being transferred from the pool to the caller.
Connections are pooled per context name and tenant by default.
Connections are rolled back when added to the pool - and the are checked before being transferred from the pool to the caller.
-
Field Summary
Fields inherited from interface org.eclnt.ccee.ICCEEConstants
AND, ASC, AVG, BETWEEN, BRC, BRO, COUNT, DEFAULT_CONTEXT, DESC, FUNCTIONRESULT, GREATER, GREATEREQUAL, IN, IS, ISNOT, LIKE, LL_DBG, LL_ERR, LL_INF, LL_WAR, LOWER, LOWEREQUAL, MAX, MIN, NULL, OR, ORDERBY, QPFUNCTION_LOWER, QPFUNCTION_UPPER, SUM -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddToPool(String contextName, Connection conn) Add a connection to the pool for the given context name.static voidClose all connections in all pools.static voidinitAccessKeyBuilder(IDBConnectionPoolAccessKeyBuilder accessKeyBuilder) Pass own implementation ofIDBConnectionPoolAccessKeyBuilderthat is used instead of the default one.static voidinitConnectionChecker(IDBConnectionPoolConnectionChecker connectionChecker) Pass own implementation ofIDBConnectionPoolConnectionCheckerthat is used instead of the default one.static ConnectionpickFromPool(String contextName) Pick a connection from the pool for the given context name.
-
Constructor Details
-
DBConnectionPool
public DBConnectionPool()
-
-
Method Details
-
initConnectionChecker
Pass own implementation ofIDBConnectionPoolConnectionCheckerthat is used instead of the default one. -
initAccessKeyBuilder
Pass own implementation ofIDBConnectionPoolAccessKeyBuilderthat is used instead of the default one. -
addToPool
Add a connection to the pool for the given context name. -
pickFromPool
Pick a connection from the pool for the given context name. If no connection is available, null is returned. The caller needs to check for null and create a new connection in this case. -
closeAllConnections
public static void closeAllConnections()Close all connections in all pools.
-