Class LoggingQueryRunner

java.lang.Object
org.apache.commons.dbutils.AbstractQueryRunner
org.apache.commons.dbutils.QueryRunner
nl.b3p.brmo.sql.LoggingQueryRunner

public class LoggingQueryRunner extends org.apache.commons.dbutils.QueryRunner
Wrapper for QueryRunner that logs the SQL to commons-logging. Enable TRACE logging to also log parameters.
  • Constructor Details

    • LoggingQueryRunner

      public LoggingQueryRunner()
    • LoggingQueryRunner

      public LoggingQueryRunner(boolean pmdKnownBroken)
    • LoggingQueryRunner

      public LoggingQueryRunner(DataSource ds)
    • LoggingQueryRunner

      public LoggingQueryRunner(org.apache.commons.dbutils.StatementConfiguration stmtConfig)
    • LoggingQueryRunner

      public LoggingQueryRunner(DataSource ds, boolean pmdKnownBroken)
    • LoggingQueryRunner

      public LoggingQueryRunner(DataSource ds, org.apache.commons.dbutils.StatementConfiguration stmtConfig)
    • LoggingQueryRunner

      public LoggingQueryRunner(DataSource ds, boolean pmdKnownBroken, org.apache.commons.dbutils.StatementConfiguration stmtConfig)
  • Method Details

    • batch

      public int[] batch(Connection conn, String sql, Object[][] params) throws SQLException
      Overrides:
      batch in class org.apache.commons.dbutils.QueryRunner
      Throws:
      SQLException
    • batch

      public int[] batch(String sql, Object[][] params) throws SQLException
      Overrides:
      batch in class org.apache.commons.dbutils.QueryRunner
      Throws:
      SQLException
    • query

      @Deprecated public <T> T query(Connection conn, String sql, Object param, org.apache.commons.dbutils.ResultSetHandler<T> rsh) throws SQLException
      Deprecated.
      Overrides:
      query in class org.apache.commons.dbutils.QueryRunner
      Throws:
      SQLException
    • query

      @Deprecated public <T> T query(Connection conn, String sql, Object[] params, org.apache.commons.dbutils.ResultSetHandler<T> rsh) throws SQLException
      Deprecated.
      Overrides:
      query in class org.apache.commons.dbutils.QueryRunner
      Throws:
      SQLException
    • query

      public <T> T query(Connection conn, String sql, org.apache.commons.dbutils.ResultSetHandler<T> rsh, Object... params) throws SQLException
      Overrides:
      query in class org.apache.commons.dbutils.QueryRunner
      Throws:
      SQLException
    • query

      public <T> T query(Connection conn, String sql, org.apache.commons.dbutils.ResultSetHandler<T> rsh) throws SQLException
      Overrides:
      query in class org.apache.commons.dbutils.QueryRunner
      Throws:
      SQLException
    • query

      @Deprecated public <T> T query(String sql, Object param, org.apache.commons.dbutils.ResultSetHandler<T> rsh) throws SQLException
      Deprecated.
      Overrides:
      query in class org.apache.commons.dbutils.QueryRunner
      Throws:
      SQLException
    • query

      @Deprecated public <T> T query(String sql, Object[] params, org.apache.commons.dbutils.ResultSetHandler<T> rsh) throws SQLException
      Deprecated.
      Overrides:
      query in class org.apache.commons.dbutils.QueryRunner
      Throws:
      SQLException
    • query

      public <T> T query(String sql, org.apache.commons.dbutils.ResultSetHandler<T> rsh, Object... params) throws SQLException
      Overrides:
      query in class org.apache.commons.dbutils.QueryRunner
      Throws:
      SQLException
    • query

      public <T> T query(String sql, org.apache.commons.dbutils.ResultSetHandler<T> rsh) throws SQLException
      Overrides:
      query in class org.apache.commons.dbutils.QueryRunner
      Throws:
      SQLException
    • update

      public int update(Connection conn, String sql) throws SQLException
      Overrides:
      update in class org.apache.commons.dbutils.QueryRunner
      Throws:
      SQLException
    • update

      public int update(Connection conn, String sql, Object param) throws SQLException
      Overrides:
      update in class org.apache.commons.dbutils.QueryRunner
      Throws:
      SQLException
    • update

      public int update(Connection conn, String sql, Object... params) throws SQLException
      Overrides:
      update in class org.apache.commons.dbutils.QueryRunner
      Throws:
      SQLException
    • update

      public int update(String sql) throws SQLException
      Overrides:
      update in class org.apache.commons.dbutils.QueryRunner
      Throws:
      SQLException
    • update

      public int update(String sql, Object param) throws SQLException
      Overrides:
      update in class org.apache.commons.dbutils.QueryRunner
      Throws:
      SQLException
    • update

      public int update(String sql, Object... params) throws SQLException
      Overrides:
      update in class org.apache.commons.dbutils.QueryRunner
      Throws:
      SQLException
    • insert

      public <T> T insert(String sql, org.apache.commons.dbutils.ResultSetHandler<T> rsh) throws SQLException
      Overrides:
      insert in class org.apache.commons.dbutils.QueryRunner
      Throws:
      SQLException
    • insert

      public <T> T insert(String sql, org.apache.commons.dbutils.ResultSetHandler<T> rsh, Object... params) throws SQLException
      Overrides:
      insert in class org.apache.commons.dbutils.QueryRunner
      Throws:
      SQLException
    • insert

      public <T> T insert(Connection conn, String sql, org.apache.commons.dbutils.ResultSetHandler<T> rsh) throws SQLException
      Overrides:
      insert in class org.apache.commons.dbutils.QueryRunner
      Throws:
      SQLException
    • insert

      public <T> T insert(Connection conn, String sql, org.apache.commons.dbutils.ResultSetHandler<T> rsh, Object... params) throws SQLException
      Overrides:
      insert in class org.apache.commons.dbutils.QueryRunner
      Throws:
      SQLException
    • insertBatch

      public <T> T insertBatch(String sql, org.apache.commons.dbutils.ResultSetHandler<T> rsh, Object[][] params) throws SQLException
      Overrides:
      insertBatch in class org.apache.commons.dbutils.QueryRunner
      Throws:
      SQLException
    • insertBatch

      public <T> T insertBatch(Connection conn, String sql, org.apache.commons.dbutils.ResultSetHandler<T> rsh, Object[][] params) throws SQLException
      Overrides:
      insertBatch in class org.apache.commons.dbutils.QueryRunner
      Throws:
      SQLException
    • execute

      public int execute(Connection conn, String sql, Object... params) throws SQLException
      Overrides:
      execute in class org.apache.commons.dbutils.QueryRunner
      Throws:
      SQLException
    • execute

      public int execute(String sql, Object... params) throws SQLException
      Overrides:
      execute in class org.apache.commons.dbutils.QueryRunner
      Throws:
      SQLException
    • execute

      public <T> List<T> execute(Connection conn, String sql, org.apache.commons.dbutils.ResultSetHandler<T> rsh, Object... params) throws SQLException
      Overrides:
      execute in class org.apache.commons.dbutils.QueryRunner
      Throws:
      SQLException
    • execute

      public <T> List<T> execute(String sql, org.apache.commons.dbutils.ResultSetHandler<T> rsh, Object... params) throws SQLException
      Overrides:
      execute in class org.apache.commons.dbutils.QueryRunner
      Throws:
      SQLException