/** * Closes a {@link ResultSet}, {@link Statement} and {@link Connection} (if not null) and logs (but does not * rethrow) any resulting {@link SQLException}. This is useful for cleaning up after a database query. * * @param resultSet * {@link ResultSet} to close * @param statement * {@link Statement} to close * @param connection * {@link Connection} to close */ public static void quietClose(ResultSet resultSet, Statement statement, Connection connection) { quietClose(resultSet); quietClose(statement); quietClose(connection); }
@Override protected void cleanup(Context context) throws IOException, InterruptedException { IOUtils.close(closeables); }
@Override protected void cleanup(Context context) throws IOException, InterruptedException { IOUtils.close(closeables); }
@Override protected void cleanup(Context context) throws IOException, InterruptedException { IOUtils.close(closeables); }
/** * Closes a {@link ResultSet}, {@link Statement} and {@link Connection} (if not null) and logs (but does not * rethrow) any resulting {@link SQLException}. This is useful for cleaning up after a database query. * * @param resultSet * {@link ResultSet} to close * @param statement * {@link Statement} to close * @param connection * {@link Connection} to close */ public static void quietClose(ResultSet resultSet, Statement statement, Connection connection) { quietClose(resultSet); quietClose(statement); quietClose(connection); }
@Override protected void cleanup(Context context) throws IOException, InterruptedException { IOUtils.close(closeables); } }
/** * Closes a {@link ResultSet}, {@link Statement} and {@link Connection} (if not null) and logs (but does not * rethrow) any resulting {@link SQLException}. This is useful for cleaning up after a database query. * * @param resultSet * {@link ResultSet} to close * @param statement * {@link Statement} to close * @param connection * {@link Connection} to close */ public static void quietClose(ResultSet resultSet, Statement statement, Connection connection) { quietClose(resultSet); quietClose(statement); quietClose(connection); }
@Override protected void cleanup(Context context) throws IOException, InterruptedException { IOUtils.close(closeables); } }
/** * Closes a {@link ResultSet}, {@link Statement} and {@link Connection} (if not null) and logs (but does not * rethrow) any resulting {@link SQLException}. This is useful for cleaning up after a database query. * * @param resultSet * {@link ResultSet} to close * @param statement * {@link Statement} to close * @param connection * {@link Connection} to close */ public static void quietClose(ResultSet resultSet, Statement statement, Connection connection) { quietClose(resultSet); quietClose(statement); quietClose(connection); }
@Override public void close() throws IOException { IOUtils.close(iterators); }
@Override public void close() { IOUtils.quietClose(resultSet, statement, connection); endOfData(); }
@Override protected void cleanup(Context context) throws IOException, InterruptedException { IOUtils.close(closeables); } }
@Override public void close() { IOUtils.quietClose(resultSet, statement, connection); endOfData(); }
@Override protected void cleanup(Context context) throws IOException, InterruptedException { IOUtils.close(closeables); } }
@Override public void close() { IOUtils.quietClose(resultSet, statement, connection); endOfData(); }
@Override protected void cleanup(Context context) throws IOException, InterruptedException { IOUtils.close(closeables); } }
@Override public final void storeMapping(long longID, String stringID) throws TasteException { Connection conn = null; PreparedStatement stmt = null; try { conn = dataSource.getConnection(); stmt = conn.prepareStatement(storeMappingSQL); stmt.setLong(1, longID); stmt.setString(2, stringID); stmt.executeUpdate(); } catch (SQLException sqle) { throw new TasteException(sqle); } finally { IOUtils.quietClose(null, stmt, conn); } }
@Override protected void cleanup(Context context) throws IOException, InterruptedException { IOUtils.close(closeables); } }
@Override public final void storeMapping(long longID, String stringID) throws TasteException { Connection conn = null; PreparedStatement stmt = null; try { conn = dataSource.getConnection(); stmt = conn.prepareStatement(storeMappingSQL); stmt.setLong(1, longID); stmt.setString(2, stringID); stmt.executeUpdate(); } catch (SQLException sqle) { throw new TasteException(sqle); } finally { IOUtils.quietClose(null, stmt, conn); } }
@Override protected void cleanup(Context context) throws IOException, InterruptedException { IOUtils.close(closeables); }