protected static void closeSilently(PreparedStatement ps) { closeSilently(ps, AutoClose.TRUE); }
private int executeCountRows(Connection c, FinalSQLString sql, Object... vs) throws PalantirSqlException { PreparedStatement ps = null; try { ps = basicSql.execute(c, sql, vs, AutoClose.FALSE); return PreparedStatements.getUpdateCount(ps); } finally { BasicSQL.closeSilently(ps); } }
protected int updateCountRowsInternal(Connection c, FinalSQLString sql, Object... vs) throws PalantirSqlException { PreparedStatement ps = null; try { ps = updateInternal(c, sql, vs, AutoClose.FALSE); return PreparedStatements.getUpdateCount(ps); } finally { closeSilently(ps); } }
throw wrapSQLExceptionWithVerboseLogging(sqle, sql.getQuery(), vs); } finally { closeSilently(ps); timerKey.stop(); for (BlobHandler cleanup : cleanups) {
creationException); } catch (Exception e) { closeSilently(rs); BasicSQLUtils.throwUncheckedIfSQLException(e); throw Throwables.throwUncheckedException(e); return runCancellably(ps, resultSetVisitor, sql, AutoClose.FALSE, fetchSize); } catch (Exception e) { closeSilently(ps); BasicSQLUtils.throwUncheckedIfSQLException(e); throw Throwables.throwUncheckedException(e);
throw wrapSQLExceptionWithVerboseLogging(sqle, sql.getQuery(), vs); } finally { closeSilently(ps); timerKey.stop(); for (BlobHandler cleanup : cleanups) {
protected static void closeSilently(PreparedStatement ps) { closeSilently(ps, AutoClose.TRUE); }
private <T> T wrapPreparedStatement(final Connection c, final FinalSQLString query, final Object[] vs, PreparedStatementVisitor<T> visitor, String description, AutoClose autoClose) throws PalantirSqlException, PalantirInterruptedException { SqlTimer.Handle timerKey = getSqlTimer().start(description, query.getKey(), query.getQuery()); PreparedStatement ps = null; try { ps = BasicSQLUtils.runUninterruptably( executeStatementExecutor, () -> createPreparedStatement(c, query.getQuery(), vs), "SQL createPreparedStatement", c); return visitor.visit(ps); } catch (PalantirSqlException sqle) { throw wrapSQLExceptionWithVerboseLogging(sqle, query.getQuery(), vs); } finally { closeSilently(ps, autoClose); timerKey.stop(); } }
protected int updateCountRowsInternal(Connection c, FinalSQLString sql, Object... vs) throws PalantirSqlException { PreparedStatement ps = null; try { ps = updateInternal(c, sql, vs, AutoClose.FALSE); return PreparedStatements.getUpdateCount(ps); } finally { closeSilently(ps); } }
private int executeCountRows(Connection c, FinalSQLString sql, Object... vs) throws PalantirSqlException { PreparedStatement ps = null; try { ps = basicSql.execute(c, sql, vs, AutoClose.FALSE); return PreparedStatements.getUpdateCount(ps); } finally { BasicSQL.closeSilently(ps); } }
throw wrapSQLExceptionWithVerboseLogging(sqle, sql.getQuery(), vs); } finally { closeSilently(ps); timerKey.stop(); for (BlobHandler cleanup : cleanups) {
creationException); } catch (Exception e) { closeSilently(rs); BasicSQLUtils.throwUncheckedIfSQLException(e); throw Throwables.throwUncheckedException(e); return runCancellably(ps, resultSetVisitor, sql, AutoClose.FALSE, fetchSize); } catch (Exception e) { closeSilently(ps); BasicSQLUtils.throwUncheckedIfSQLException(e); throw Throwables.throwUncheckedException(e);
throw wrapSQLExceptionWithVerboseLogging(sqle, sql.getQuery(), vs); } finally { closeSilently(ps); timerKey.stop(); for (BlobHandler cleanup : cleanups) {
private <T> T wrapPreparedStatement(final Connection c, final FinalSQLString query, final Object[] vs, PreparedStatementVisitor<T> visitor, String description, AutoClose autoClose) throws PalantirSqlException, PalantirInterruptedException { SqlTimer.Handle timerKey = getSqlTimer().start(description, query.getKey(), query.getQuery()); PreparedStatement ps = null; try { ps = BasicSQLUtils.runUninterruptably( executeStatementExecutor, () -> createPreparedStatement(c, query.getQuery(), vs), "SQL createPreparedStatement", c); return visitor.visit(ps); } catch (PalantirSqlException sqle) { throw wrapSQLExceptionWithVerboseLogging(sqle, query.getQuery(), vs); } finally { closeSilently(ps, autoClose); timerKey.stop(); } }