Class AppConnectionService
java.lang.Object
fr.paris.lutece.portal.service.database.AppConnectionService
This class provides a Database Connection Service based on pooled connections.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic voidfreeConnection(Connection conn) Releases a connection and replaces it in the poolstatic ConnectionReturns a connection to database from the pool namestatic PluginConnectionServiceReturns a default Plugin Connection Servicestatic voidgetPoolList(ReferenceList list) Gets the list of all pools defined in the db.properties filestatic PoolManagerGets a reference on the current Pool Managerstatic voidInitializes the connection pool and sets the pool manager instancestatic voidReleases all the connections on all the pools
-
Field Details
-
NO_POOL_DEFINED
- See Also:
-
DEFAULT_POOL_NAME
- See Also:
-
-
Method Details
-
init
public static void init(String strConfigPath, String strConfigFilename, String strPoolName) throws LuteceInitException Initializes the connection pool and sets the pool manager instance- Parameters:
strConfigPath- The relative Config pathstrConfigFilename- The config file namestrPoolName- The pool name- Throws:
LuteceInitException- If an error occured
-
getConnection
Returns a connection to database from the pool name- Returns:
- a connection to database from the pool
-
freeConnection
Releases a connection and replaces it in the pool- Parameters:
conn- The connection to realease
-
releasePool
public static void releasePool()Releases all the connections on all the pools -
getPoolManager
Gets a reference on the current Pool Manager- Returns:
- The current Pool Manager
-
getPoolList
Gets the list of all pools defined in the db.properties file- Parameters:
list- The Reference List
-
getDefaultConnectionService
Returns a default Plugin Connection Service- Returns:
- The connection Service
-