@Override public ResultSet executeQuery(String sql) throws SQLException { if (Databases.LOG.isFINE()) { Databases.LOG.FINE(sql); } Watch w = Watch.start(); try (Operation op = new Operation(() -> sql, Duration.ofSeconds(30))) { return stmt.executeQuery(sql); } finally { updateStatistics(sql, w); } }
@Override public int executeUpdate(String sql, int[] columnIndexes) throws SQLException { if (Databases.LOG.isFINE()) { Databases.LOG.FINE(sql); } Watch w = Watch.start(); try (Operation op = new Operation(() -> sql, Duration.ofSeconds(30))) { return stmt.executeUpdate(sql, columnIndexes); } finally { updateStatistics(sql, w); } }
@Override public boolean execute() throws SQLException { if (Databases.LOG.isFINE()) { Databases.LOG.FINE(preparedSQL); } Watch w = Watch.start(); try (Operation op = new Operation(() -> preparedSQL, Duration.ofSeconds(30))) { return delegate.execute(); } finally { updateStatistics(preparedSQL, w); } }
@Override public boolean execute(String sql, int autoGeneratedKeys) throws SQLException { if (Databases.LOG.isFINE()) { Databases.LOG.FINE(sql); } Watch w = Watch.start(); try (Operation op = new Operation(() -> sql, Duration.ofSeconds(30))) { return delegate.execute(sql, autoGeneratedKeys); } finally { updateStatistics(sql, w); } }
@Override public int executeUpdate(String sql) throws SQLException { if (Databases.LOG.isFINE()) { Databases.LOG.FINE(sql); } Watch w = Watch.start(); try (Operation op = new Operation(() -> sql, Duration.ofSeconds(30))) { return stmt.executeUpdate(sql); } finally { updateStatistics(sql, w); } }
@Override public ResultSet executeQuery(String sql) throws SQLException { if (Databases.LOG.isFINE()) { Databases.LOG.FINE(sql); } Watch w = Watch.start(); try (Operation op = new Operation(() -> sql, Duration.ofSeconds(30))) { return delegate.executeQuery(sql); } finally { updateStatistics(sql, w); } }
@Override public boolean execute(String sql) throws SQLException { if (Databases.LOG.isFINE()) { Databases.LOG.FINE(sql); } Watch w = Watch.start(); try (Operation op = new Operation(() -> sql, Duration.ofSeconds(30))) { return stmt.execute(sql); } finally { updateStatistics(sql, w); } }
@Override public boolean execute(String sql, String[] columnNames) throws SQLException { if (Databases.LOG.isFINE()) { Databases.LOG.FINE(sql); } Watch w = Watch.start(); try (Operation op = new Operation(() -> sql, Duration.ofSeconds(30))) { return stmt.execute(sql, columnNames); } finally { updateStatistics(sql, w); } }
@Override public int executeUpdate(String sql) throws SQLException { if (Databases.LOG.isFINE()) { Databases.LOG.FINE(sql); } Watch w = Watch.start(); try (Operation op = new Operation(() -> sql, Duration.ofSeconds(30))) { return delegate.executeUpdate(sql); } finally { updateStatistics(sql, w); } }
@Override public int executeUpdate() throws SQLException { if (Databases.LOG.isFINE()) { Databases.LOG.FINE(preparedSQL); } Watch w = Watch.start(); try (Operation op = new Operation(() -> preparedSQL, Duration.ofSeconds(30))) { return delegate.executeUpdate(); } finally { updateStatistics(preparedSQL, w); } }
@Override public boolean execute(String sql, String[] columnNames) throws SQLException { if (Databases.LOG.isFINE()) { Databases.LOG.FINE(sql); } Watch w = Watch.start(); try (Operation op = new Operation(() -> sql, Duration.ofSeconds(30))) { return delegate.execute(sql, columnNames); } finally { updateStatistics(sql, w); } }
@Override public int executeUpdate(String sql, String[] columnNames) throws SQLException { if (Databases.LOG.isFINE()) { Databases.LOG.FINE(sql); } Watch w = Watch.start(); try (Operation op = new Operation(() -> sql, Duration.ofSeconds(30))) { return stmt.executeUpdate(sql, columnNames); } finally { updateStatistics(sql, w); } }
@Override public boolean execute(String sql, int autoGeneratedKeys) throws SQLException { if (Databases.LOG.isFINE()) { Databases.LOG.FINE(sql); } Watch w = Watch.start(); try (Operation op = new Operation(() -> sql, Duration.ofSeconds(30))) { return stmt.execute(sql, autoGeneratedKeys); } finally { updateStatistics(sql, w); } }
@Override public boolean execute(String sql, int[] columnIndexes) throws SQLException { if (Databases.LOG.isFINE()) { Databases.LOG.FINE(sql); } Watch w = Watch.start(); try (Operation op = new Operation(() -> sql, Duration.ofSeconds(30))) { return stmt.execute(sql, columnIndexes); } finally { updateStatistics(sql, w); } }
@Override public ResultSet executeQuery() throws SQLException { if (Databases.LOG.isFINE()) { Databases.LOG.FINE(preparedSQL); } Watch w = Watch.start(); try (Operation op = new Operation(() -> preparedSQL, Duration.ofSeconds(30))) { return delegate.executeQuery(); } finally { updateStatistics(preparedSQL, w); } }
@Override public boolean execute(String sql) throws SQLException { if (Databases.LOG.isFINE()) { Databases.LOG.FINE(sql); } Watch w = Watch.start(); try (Operation op = new Operation(() -> sql, Duration.ofSeconds(30))) { return delegate.execute(sql); } finally { updateStatistics(sql, w); } }
@Override public int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException { if (Databases.LOG.isFINE()) { Databases.LOG.FINE(sql); } Watch w = Watch.start(); try (Operation op = new Operation(() -> sql, Duration.ofSeconds(30))) { return delegate.executeUpdate(sql, autoGeneratedKeys); } finally { updateStatistics(sql, w); } }
@Override public int executeUpdate(String sql, String[] columnNames) throws SQLException { if (Databases.LOG.isFINE()) { Databases.LOG.FINE(sql); } Watch w = Watch.start(); try (Operation op = new Operation(() -> sql, Duration.ofSeconds(30))) { return delegate.executeUpdate(sql, columnNames); } finally { updateStatistics(sql, w); } }
@Override public boolean execute(String sql, int[] columnIndexes) throws SQLException { if (Databases.LOG.isFINE()) { Databases.LOG.FINE(sql); } Watch w = Watch.start(); try (Operation op = new Operation(() -> sql, Duration.ofSeconds(30))) { return delegate.execute(sql, columnIndexes); } finally { updateStatistics(sql, w); } }
@Override public void iterate(Function<Row, Boolean> handler, @Nullable Limit limit) throws SQLException { Watch w = Watch.start(); try (ResultSet rs = query.prepareStmt().executeQuery()) { query.avarage.addValue(w.elapsedMillis()); TaskContext tc = TaskContext.get(); processResultSet(handler, limit, rs, tc); } }