Package net.simplace.core.database
Class ConnectionPoolManager
java.lang.Object
net.simplace.core.database.ConnectionPoolManager
Simple implementation of a JDBC connection pool manager.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
createH2TempPool
(String aPoolName, int aPoolSize) static void
createHSQLTempPool
(String aPoolName, int aPoolSize) static void
createPermanentPool
(String aPoolName) void
createPool
(String aPoolName, String aJDBCDriver, String aJDBCURL, String aSystemID, String aUser, String aPassword, int aMaxConnections) static void
createTempPool
(String aPoolName) void
freeConnection
(String aName, Connection aConnection) void
freeConnection
(Connection aConnection) getConnection
(String aName) getConnection
(String aName, long aTime) static ConnectionPoolManager
boolean
void
void
void
releaseAll
(String aSystemID) void
renewPool
(String aPoolName, String aJDBCDriver, String aJDBCURL, String aSystemID, String aUser, String aPassword, int aMaxConnections)
-
Constructor Details
-
ConnectionPoolManager
public ConnectionPoolManager()
-
-
Method Details
-
getInstance
- Returns:
- connection pool manager
-
freeConnection
- Parameters:
aName
-aConnection
-
-
freeConnection
- Parameters:
aConnection
-
-
getConnection
- Parameters:
aName
-- Returns:
- a Connection specified by aName
- Throws:
SQLException
-
getConnection
- Parameters:
aName
-aTime
-- Returns:
- a Connection specified by aName
- Throws:
SQLException
-
releaseAll
public void releaseAll() -
release
- Parameters:
aPoolKey
-
-
releaseAll
- Parameters:
aSystemID
-
-
createPool
public void createPool(String aPoolName, String aJDBCDriver, String aJDBCURL, String aSystemID, String aUser, String aPassword, int aMaxConnections) - Parameters:
aPoolName
-aJDBCDriver
-aJDBCURL
-aSystemID
-aUser
-aPassword
-aMaxConnections
-
-
renewPool
public void renewPool(String aPoolName, String aJDBCDriver, String aJDBCURL, String aSystemID, String aUser, String aPassword, int aMaxConnections) - Parameters:
aPoolName
-aJDBCDriver
-aJDBCURL
-aSystemID
-aUser
-aPassword
-aMaxConnections
-
-
createTempPool
- Parameters:
aPoolName
-
-
createH2TempPool
- Parameters:
aPoolName
-aPoolSize
-
-
createHSQLTempPool
- Parameters:
aPoolName
-aPoolSize
-
-
createPermanentPool
- Parameters:
aPoolName
-
-
hasPool
-