@Override public void onQueryExecuteTimeLimitExceeded(ConnectionHandle handle, Statement statement, String sql, Map<Object, Object> logParams, long timeElapsedInNs) { double timeMs = timeElapsedInNs / 1000d; String query = PoolUtil.fillLogParams(sql, logParams); LOGGER.warn("Query execute time limit exceeded ({}ms) - query: {}", timeMs, query); } });
@Deprecated public void onQueryExecuteTimeLimitExceeded(String sql, Map<Object, Object> logParams){ StringBuilder sb = new StringBuilder("Query execute time limit exceeded. Query: "); sb.append(PoolUtil.fillLogParams(sql, logParams)); logger.warn(sb.toString()); }
try{ if (this.logStatementsEnabled && logger.isDebugEnabled()){ logger.debug(PoolUtil.fillLogParams(this.batchSQL.toString(), this.logParams));
/** * {@inheritDoc} * * @see java.sql.Statement#executeUpdate(java.lang.String, int[]) */ // @Override public int executeUpdate(String sql, int[] columnIndexes) throws SQLException { int result = 0; checkClosed(); try{ if (this.logStatementsEnabled && logger.isDebugEnabled()){ logger.debug(PoolUtil.fillLogParams(sql, this.logParams), columnIndexes); } long queryStartTime = queryTimerStart(); if (this.connectionHook != null){ this.connectionHook.onBeforeStatementExecute(this.connectionHandle, this, sql, this.logParams); } result = this.internalStatement.executeUpdate(sql, columnIndexes); if (this.connectionHook != null){ this.connectionHook.onAfterStatementExecute(this.connectionHandle, this, sql, this.logParams); } queryTimerEnd(sql, queryStartTime); } catch (SQLException e) { throw this.connectionHandle.markPossiblyBroken(e); } return result; }
/** * {@inheritDoc} * * @see java.sql.Statement#execute(java.lang.String) */ // @Override public boolean execute(String sql) throws SQLException { boolean result = false; checkClosed(); try { if (this.logStatementsEnabled && logger.isDebugEnabled()){ logger.debug(PoolUtil.fillLogParams(sql, this.logParams)); } long timer = queryTimerStart(); if (this.connectionHook != null){ this.connectionHook.onBeforeStatementExecute(this.connectionHandle, this, sql, this.logParams); } result = this.internalStatement.execute(sql); if (this.connectionHook != null){ this.connectionHook.onAfterStatementExecute(this.connectionHandle, this, sql, this.logParams); } queryTimerEnd(sql, timer); } catch (SQLException e) { throw this.connectionHandle.markPossiblyBroken(e); } return result; }
/** * {@inheritDoc} * * @see java.sql.Statement#executeUpdate(java.lang.String, java.lang.String[]) */ // @Override public int executeUpdate(String sql, String[] columnNames) throws SQLException { int result = 0; checkClosed(); try{ if (this.logStatementsEnabled && logger.isDebugEnabled()){ logger.debug(PoolUtil.fillLogParams(sql, this.logParams)); } long queryStartTime = queryTimerStart(); if (this.connectionHook != null){ this.connectionHook.onBeforeStatementExecute(this.connectionHandle, this, sql, this.logParams); } result = this.internalStatement.executeUpdate(sql, columnNames); if (this.connectionHook != null){ this.connectionHook.onAfterStatementExecute(this.connectionHandle, this, sql, this.logParams); } queryTimerEnd(sql, queryStartTime); } catch (SQLException e) { throw this.connectionHandle.markPossiblyBroken(e); } return result; }
try{ if (this.logStatementsEnabled && logger.isDebugEnabled()){ logger.debug(PoolUtil.fillLogParams(sql, this.logParams));
/** * {@inheritDoc} * * @see java.sql.PreparedStatement#executeQuery() */ // @Override public ResultSet executeQuery() throws SQLException { checkClosed(); try { if (this.logStatementsEnabled){ logger.debug(PoolUtil.fillLogParams(this.sql, this.logParams)); } long queryStartTime = queryTimerStart(); if (this.connectionHook != null){ this.connectionHook.onBeforeStatementExecute(this.connectionHandle, this, this.sql, this.logParams); } ResultSet result = this.internalPreparedStatement.executeQuery(); if (this.connectionHook != null){ this.connectionHook.onAfterStatementExecute(this.connectionHandle, this, this.sql, this.logParams); } queryTimerEnd(this.sql, queryStartTime); return result; } catch (SQLException e) { throw this.connectionHandle.markPossiblyBroken(e); } }
/** * {@inheritDoc} * * @see java.sql.Statement#execute(java.lang.String, int) */ // @Override public boolean execute(String sql, int autoGeneratedKeys) throws SQLException { boolean result = false; checkClosed(); try{ if (this.logStatementsEnabled && logger.isDebugEnabled()){ logger.debug(PoolUtil.fillLogParams(sql, this.logParams)); } long queryStartTime = queryTimerStart(); if (this.connectionHook != null){ this.connectionHook.onBeforeStatementExecute(this.connectionHandle, this, sql, this.logParams); } result = this.internalStatement.execute(sql, autoGeneratedKeys); if (this.connectionHook != null){ this.connectionHook.onAfterStatementExecute(this.connectionHandle, this, sql, this.logParams); } queryTimerEnd(sql, queryStartTime); } catch (SQLException e) { throw this.connectionHandle.markPossiblyBroken(e); } return result; }
/** * {@inheritDoc} * * @see java.sql.Statement#execute(java.lang.String, java.lang.String[]) */ // @Override public boolean execute(String sql, String[] columnNames) throws SQLException { boolean result = false; checkClosed(); try{ if (this.logStatementsEnabled && logger.isDebugEnabled()){ logger.debug(PoolUtil.fillLogParams(sql, this.logParams)); } long queryStartTime = queryTimerStart(); if (this.connectionHook != null){ this.connectionHook.onBeforeStatementExecute(this.connectionHandle, this, sql, this.logParams); } result = this.internalStatement.execute(sql, columnNames); if (this.connectionHook != null){ this.connectionHook.onAfterStatementExecute(this.connectionHandle, this, sql, this.logParams); } queryTimerEnd(sql, queryStartTime); } catch (SQLException e) { throw this.connectionHandle.markPossiblyBroken(e); } return result; }
/** * {@inheritDoc} * * @see java.sql.Statement#executeQuery(java.lang.String) */ // @Override public ResultSet executeQuery(String sql) throws SQLException { ResultSet result = null; checkClosed(); try{ if (this.logStatementsEnabled && logger.isDebugEnabled()){ logger.debug(PoolUtil.fillLogParams(sql, this.logParams)); } long queryStartTime = queryTimerStart(); if (this.connectionHook != null){ this.connectionHook.onBeforeStatementExecute(this.connectionHandle, this, sql, this.logParams); } result = this.internalStatement.executeQuery(sql); if (this.connectionHook != null){ this.connectionHook.onAfterStatementExecute(this.connectionHandle, this, sql, this.logParams); } queryTimerEnd(sql, queryStartTime); } catch (SQLException e) { throw this.connectionHandle.markPossiblyBroken(e); } return result; }
/** * {@inheritDoc} * * @see java.sql.Statement#executeUpdate(java.lang.String) */ // @Override public int executeUpdate(String sql) throws SQLException { int result = 0; checkClosed(); try{ if (this.logStatementsEnabled && logger.isDebugEnabled()){ logger.debug(PoolUtil.fillLogParams(sql, this.logParams)); } long queryStartTime = queryTimerStart(); if (this.connectionHook != null){ this.connectionHook.onBeforeStatementExecute(this.connectionHandle, this, sql, this.logParams); } result = this.internalStatement.executeUpdate(sql); if (this.connectionHook != null){ this.connectionHook.onAfterStatementExecute(this.connectionHandle, this, sql, this.logParams); } queryTimerEnd(sql, queryStartTime); } catch (SQLException e) { throw this.connectionHandle.markPossiblyBroken(e); } return result; }
/** * {@inheritDoc} * * @see java.sql.Statement#executeUpdate(java.lang.String, int) */ // @Override public int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException { int result = 0; checkClosed(); try{ if (this.logStatementsEnabled && logger.isDebugEnabled()){ logger.debug(PoolUtil.fillLogParams(sql, this.logParams)); } long queryStartTime = queryTimerStart(); if (this.connectionHook != null){ this.connectionHook.onBeforeStatementExecute(this.connectionHandle, this, sql, this.logParams); } result = this.internalStatement.executeUpdate(sql, autoGeneratedKeys); if (this.connectionHook != null){ this.connectionHook.onAfterStatementExecute(this.connectionHandle, this, sql, this.logParams); } queryTimerEnd(sql, queryStartTime); } catch (SQLException e) { throw this.connectionHandle.markPossiblyBroken(e); } return result; }
/** * {@inheritDoc} * * @see java.sql.PreparedStatement#execute() */ // @Override public boolean execute() throws SQLException { checkClosed(); try { if (this.logStatementsEnabled){ logger.debug(PoolUtil.fillLogParams(this.sql, this.logParams)); } long queryStartTime = queryTimerStart(); if (this.connectionHook != null){ this.connectionHook.onBeforeStatementExecute(this.connectionHandle, this, this.sql, this.logParams); } boolean result = this.internalPreparedStatement.execute(); if (this.connectionHook != null){ this.connectionHook.onAfterStatementExecute(this.connectionHandle, this, this.sql, this.logParams); } queryTimerEnd(this.sql, queryStartTime); return result; } catch (SQLException e) { throw this.connectionHandle.markPossiblyBroken(e); } }
/** * {@inheritDoc} * * @see java.sql.PreparedStatement#executeUpdate() */ // @Override public int executeUpdate() throws SQLException { checkClosed(); try { if (this.logStatementsEnabled){ logger.debug(PoolUtil.fillLogParams(this.sql, this.logParams)); } long queryStartTime = queryTimerStart(); if (this.connectionHook != null){ this.connectionHook.onBeforeStatementExecute(this.connectionHandle, this, this.sql, this.logParams); } int result = this.internalPreparedStatement.executeUpdate(); if (this.connectionHook != null){ this.connectionHook.onAfterStatementExecute(this.connectionHandle, this, this.sql, this.logParams); } queryTimerEnd(this.sql, queryStartTime); return result; } catch (SQLException e) { throw this.connectionHandle.markPossiblyBroken(e); } }