return getConnection(defaultPoolName);
}
public Connection getConnection(String poolName) throws NoConnectionAvailableException {
if (poolName == null || poolName.equals(""))
throw new NoConnectionAvailableException("Couldn´t get a connection for an unnamed pool");
Connection conn = null;
try {
conn = DriverManager
.getConnection("jdbc:apache:commons:dbcp:" + contextName + "_" + poolName);
} catch (SQLException ex) {
log4j.error(ex);
throw new NoConnectionAvailableException(
"There are no connections available in jdbc:apache:commons:dbcp:" + contextName + "_"
+ poolName);
}
return conn;
}