Java Utililty Methods JDBC Connection Pool

List of utility methods to do JDBC Connection Pool

Description

The list of methods to do JDBC Connection Pool are organized into topic(s).

Method

ConnectiongetConnection()
Helper method to get a connection from the connection pool.
if (!driverSetup) {
    throw new Exception("Driver has not been set up with a call to setupDriver().");
return DriverManager.getConnection("jdbc:apache:commons:dbcp:local");
ConnectiongetConnectionFromPool()
Returns a connection from the previous configurePool the pool
try {
    return DriverManager.getConnection(POOL_DRIVER_URL + POOL_NAME);
} catch (SQLException e) {
    throw new RuntimeException(e);
ConnectiongetDatabaseConnection(String propertiesFile)
get Database Connection
Properties properties = new Properties();
properties.load(new FileInputStream(propertiesFile));
String jdbcClassName = properties.getProperty("jdbc.class.name");
String jdbcDatabase = properties.getProperty("jdbc.database");
String jdbcUsername = properties.getProperty("jdbc.username");
String jdbcPassword = properties.getProperty("jdbc.password");
Class.forName(jdbcClassName);
return DriverManager.getConnection(jdbcDatabase, jdbcUsername, jdbcPassword);
...