net.simplace.core.database.ConnectionPoolManager
Simple implementation of a JDBC connection pool manager.
public class ConnectionPoolManager {
// Public Constructors
public ConnectionPoolManager();
// Class Methods public static void
createTempPool(String aPoolName);
public static void
createH2TempPool(String aPoolName, int aPoolSize);
public static void
createHSQLTempPool(String aPoolName, int aPoolSize);
public static void
createPermanentPool(String aPoolName);
// Public Instance Methods public synchronized void
freeConnection(String aName, Connection aConnection);
public synchronized void
freeConnection(Connection aConnection);
public synchronized Connection
getConnection(String aName)
throws SQLException;
returns a Connection specified by aName
public synchronized Connection
getConnection(String aName, long aTime)
throws SQLException;
returns a Connection specified by aName
public synchronized void releaseAll();
public synchronized void
release(String aPoolKey);
public synchronized void
releaseAll(String aSystemID);
public synchronized void
createPool(String aPoolName, String aJDBCDriver,
String aJDBCURL, String aSystemID, String aUser, String aPassword, int
aMaxConnections);
- aPoolName
- aJDBCDriver
- aJDBCURL
- aSystemID
- aUser
- aPassword
- aMaxConnections
public synchronized void
renewPool(String aPoolName, String aJDBCDriver,
String aJDBCURL, String aSystemID, String aUser, String aPassword, int
aMaxConnections);
- aPoolName
- aJDBCDriver
- aJDBCURL
- aSystemID
- aUser
- aPassword
- aMaxConnections
public boolean hasPool(String aName);
}
Returned by: getInstance()