protected void execute(final String query, final ResultSetJob job) throws SQLException, IOException { final Connection connection = getConnection(); Statement statement = null; try { statement = connection.createStatement(); if (statement.execute(query)) { job.work(statement.getResultSet()); } } finally { if (statement != null) { statement.close(); } connection.close(); } }
protected void executeQuery(final String query, final ResultSetJob job) throws SQLException, IOException { final Connection connection = getConnection(); Statement statement = null; try { statement = connection.createStatement(); final ResultSet rs = statement.executeQuery(query); job.work(rs); } finally { if (statement != null) { statement.close(); } connection.close(); } }
protected void execute(final String query, final ResultSetJob job) throws SQLException, IOException { final Connection connection = getConnection(); Statement statement = null; try { statement = connection.createStatement(); if (statement.execute(query)) { job.work(statement.getResultSet()); } } finally { if (statement != null) { statement.close(); } connection.close(); } }
protected void executeQuery(final String query, final ResultSetJob job) throws SQLException, IOException { final Connection connection = getConnection(); Statement statement = null; try { statement = connection.createStatement(); final ResultSet rs = statement.executeQuery(query); job.work(rs); } finally { if (statement != null) { statement.close(); } connection.close(); } }