@Override public boolean execute(String sql, int autoGeneratedKeys) throws SQLException { statementInformation.setStatementQuery(sql); SQLException e = null; long start = System.nanoTime(); try { eventListener.onBeforeExecute(statementInformation, sql); return delegate.execute(sql, autoGeneratedKeys); } catch (SQLException sqle) { e = sqle; throw e; } finally { eventListener.onAfterExecute(statementInformation, System.nanoTime() - start, sql, e); } }
@Override public boolean execute(String sql) throws SQLException { statementInformation.setStatementQuery(sql); SQLException e = null; long start = System.nanoTime(); try { eventListener.onBeforeExecute(statementInformation, sql); return delegate.execute(sql); } catch (SQLException sqle) { e = sqle; throw e; } finally { eventListener.onAfterExecute(statementInformation, System.nanoTime() - start, sql, e); } }
@Override public boolean execute(String sql, String[] columnNames) throws SQLException { statementInformation.setStatementQuery(sql); SQLException e = null; long start = System.nanoTime(); try { eventListener.onBeforeExecute(statementInformation, sql); return delegate.execute(sql, columnNames); } catch (SQLException sqle) { e = sqle; throw e; } finally { eventListener.onAfterExecute(statementInformation, System.nanoTime() - start, sql, e); } }
@Override public boolean execute(String sql, int[] columnIndexes) throws SQLException { statementInformation.setStatementQuery(sql); SQLException e = null; long start = System.nanoTime(); try { eventListener.onBeforeExecute(statementInformation, sql); return delegate.execute(sql, columnIndexes); } catch (SQLException sqle) { e = sqle; throw e; } finally { eventListener.onAfterExecute(statementInformation, System.nanoTime() - start, sql, e); } }
@Override public int executeUpdate(String sql, int[] columnIndexes) throws SQLException { statementInformation.setStatementQuery(sql); SQLException e = null; long start = System.nanoTime(); int rowCount = 0; try { eventListener.onBeforeExecuteUpdate(statementInformation, sql); rowCount = delegate.executeUpdate(sql, columnIndexes); return rowCount; } catch (SQLException sqle) { e = sqle; throw e; } finally { eventListener.onAfterExecuteUpdate(statementInformation, System.nanoTime() - start, sql, rowCount, e); } }
@Override public int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException { statementInformation.setStatementQuery(sql); SQLException e = null; long start = System.nanoTime(); int rowCount = 0; try { eventListener.onBeforeExecuteUpdate(statementInformation, sql); rowCount = delegate.executeUpdate(sql, autoGeneratedKeys); return rowCount; } catch (SQLException sqle) { e = sqle; throw e; } finally { eventListener.onAfterExecuteUpdate(statementInformation, System.nanoTime() - start, sql, rowCount, e); } }
@Override public int executeUpdate(String sql) throws SQLException { statementInformation.setStatementQuery(sql); SQLException e = null; long start = System.nanoTime(); int rowCount = 0; try { eventListener.onBeforeExecuteUpdate(statementInformation, sql); rowCount = delegate.executeUpdate(sql); return rowCount; } catch (SQLException sqle) { e = sqle; throw e; } finally { eventListener.onAfterExecuteUpdate(statementInformation, System.nanoTime() - start, sql, rowCount, e); } }
@Override public int executeUpdate(String sql, String[] columnNames) throws SQLException { statementInformation.setStatementQuery(sql); SQLException e = null; long start = System.nanoTime(); int rowCount = 0; try { eventListener.onBeforeExecuteUpdate(statementInformation, sql); rowCount = delegate.executeUpdate(sql, columnNames); return rowCount; } catch (SQLException sqle) { e = sqle; throw e; } finally { eventListener.onAfterExecuteUpdate(statementInformation, System.nanoTime() - start, sql, rowCount, e); } }
@Override public void addBatch(String sql) throws SQLException { if (statementInformation.getStatementQuery() == null) { statementInformation.setStatementQuery(sql); } else { statementInformation.setStatementQuery(sql + LINE_SEPARATOR + statementInformation.getStatementQuery()); } SQLException e = null; long start = System.nanoTime(); try { eventListener.onBeforeAddBatch(statementInformation, sql); delegate.addBatch(sql); } catch (SQLException sqle) { e = sqle; throw e; } finally { eventListener.onAfterAddBatch(statementInformation, System.nanoTime() - start, sql, e); } }
@Override public ResultSet executeQuery(String sql) throws SQLException { statementInformation.setStatementQuery(sql); SQLException e = null; long start = System.nanoTime(); try { eventListener.onBeforeExecuteQuery(statementInformation, sql); return ResultSetWrapper.wrap(delegate.executeQuery(sql), new ResultSetInformation(statementInformation), eventListener); } catch (SQLException sqle) { e = sqle; throw e; } finally { eventListener.onAfterExecuteQuery(statementInformation, System.nanoTime() - start, sql, e); } }
@Override public boolean execute(String sql, String[] columnNames) throws SQLException { statementInformation.setStatementQuery(sql); SQLException e = null; long start = System.nanoTime(); try { eventListener.onBeforeExecute(statementInformation, sql); return delegate.execute(sql, columnNames); } catch (SQLException sqle) { e = sqle; throw e; } finally { eventListener.onAfterExecute(statementInformation, System.nanoTime() - start, sql, e); } }
@Override public boolean execute(String sql, int autoGeneratedKeys) throws SQLException { statementInformation.setStatementQuery(sql); SQLException e = null; long start = System.nanoTime(); try { eventListener.onBeforeExecute(statementInformation, sql); return delegate.execute(sql, autoGeneratedKeys); } catch (SQLException sqle) { e = sqle; throw e; } finally { eventListener.onAfterExecute(statementInformation, System.nanoTime() - start, sql, e); } }
@Override public boolean execute(String sql) throws SQLException { statementInformation.setStatementQuery(sql); SQLException e = null; long start = System.nanoTime(); try { eventListener.onBeforeExecute(statementInformation, sql); return delegate.execute(sql); } catch (SQLException sqle) { e = sqle; throw e; } finally { eventListener.onAfterExecute(statementInformation, System.nanoTime() - start, sql, e); } }
@Override public boolean execute(String sql, int[] columnIndexes) throws SQLException { statementInformation.setStatementQuery(sql); SQLException e = null; long start = System.nanoTime(); try { eventListener.onBeforeExecute(statementInformation, sql); return delegate.execute(sql, columnIndexes); } catch (SQLException sqle) { e = sqle; throw e; } finally { eventListener.onAfterExecute(statementInformation, System.nanoTime() - start, sql, e); } }
@Override public int executeUpdate(String sql) throws SQLException { statementInformation.setStatementQuery(sql); SQLException e = null; long start = System.nanoTime(); int rowCount = 0; try { eventListener.onBeforeExecuteUpdate(statementInformation, sql); rowCount = delegate.executeUpdate(sql); return rowCount; } catch (SQLException sqle) { e = sqle; throw e; } finally { eventListener.onAfterExecuteUpdate(statementInformation, System.nanoTime() - start, sql, rowCount, e); } }
@Override public int executeUpdate(String sql, int[] columnIndexes) throws SQLException { statementInformation.setStatementQuery(sql); SQLException e = null; long start = System.nanoTime(); int rowCount = 0; try { eventListener.onBeforeExecuteUpdate(statementInformation, sql); rowCount = delegate.executeUpdate(sql, columnIndexes); return rowCount; } catch (SQLException sqle) { e = sqle; throw e; } finally { eventListener.onAfterExecuteUpdate(statementInformation, System.nanoTime() - start, sql, rowCount, e); } }
@Override public int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException { statementInformation.setStatementQuery(sql); SQLException e = null; long start = System.nanoTime(); int rowCount = 0; try { eventListener.onBeforeExecuteUpdate(statementInformation, sql); rowCount = delegate.executeUpdate(sql, autoGeneratedKeys); return rowCount; } catch (SQLException sqle) { e = sqle; throw e; } finally { eventListener.onAfterExecuteUpdate(statementInformation, System.nanoTime() - start, sql, rowCount, e); } }
@Override public int executeUpdate(String sql, String[] columnNames) throws SQLException { statementInformation.setStatementQuery(sql); SQLException e = null; long start = System.nanoTime(); int rowCount = 0; try { eventListener.onBeforeExecuteUpdate(statementInformation, sql); rowCount = delegate.executeUpdate(sql, columnNames); return rowCount; } catch (SQLException sqle) { e = sqle; throw e; } finally { eventListener.onAfterExecuteUpdate(statementInformation, System.nanoTime() - start, sql, rowCount, e); } }
@Override public void addBatch(String sql) throws SQLException { if (statementInformation.getStatementQuery() == null) { statementInformation.setStatementQuery(sql); } else { statementInformation.setStatementQuery(sql + LINE_SEPARATOR + statementInformation.getStatementQuery()); } SQLException e = null; long start = System.nanoTime(); try { eventListener.onBeforeAddBatch(statementInformation, sql); delegate.addBatch(sql); } catch (SQLException sqle) { e = sqle; throw e; } finally { eventListener.onAfterAddBatch(statementInformation, System.nanoTime() - start, sql, e); } }
@Override public ResultSet executeQuery(String sql) throws SQLException { statementInformation.setStatementQuery(sql); SQLException e = null; long start = System.nanoTime(); try { eventListener.onBeforeExecuteQuery(statementInformation, sql); return ResultSetWrapper.wrap(delegate.executeQuery(sql), new ResultSetInformation(statementInformation), eventListener); } catch (SQLException sqle) { e = sqle; throw e; } finally { eventListener.onAfterExecuteQuery(statementInformation, System.nanoTime() - start, sql, e); } }