/** * Opens a database connection using a specified connection pool * to create a statement for SQL updates. * @param poolname name of the connection pool from which to get a connection */ private void openConnection(String poolname) throws SQLException { if (poolname == null || poolname.equals("")) throw new IllegalArgumentException("Please specify the name of a defined connection pool"); try { this.con = cpm.getConnection(poolname); this.statement = con.createStatement(); } catch (SQLException sqlx) { try { statement.close(); } catch (SQLException sqlx2) {} try { con.close(); } catch (SQLException sqlx2) {} } }