Class LoggingConnectionDecorator.LoggingConnection.LoggingStatement

  • All Implemented Interfaces:
    java.lang.AutoCloseable, java.sql.Statement, java.sql.Wrapper, Closeable
    Enclosing class:
    LoggingConnectionDecorator.LoggingConnection

    protected class LoggingConnectionDecorator.LoggingConnection.LoggingStatement
    extends DelegatingStatement
    Statement wrapper that logs SQL to the parent data source and remembers the last piece of SQL to be executed on it.
    • Constructor Detail

      • LoggingStatement

        public LoggingStatement​(java.sql.Statement stmnt)
                         throws java.sql.SQLException
        Throws:
        java.sql.SQLException
    • Method Detail

      • wrapResult

        protected java.sql.ResultSet wrapResult​(java.sql.ResultSet rs,
                                                boolean wrap)
        Overrides:
        wrapResult in class DelegatingStatement
      • cancel

        public void cancel()
                    throws java.sql.SQLException
        Specified by:
        cancel in interface java.sql.Statement
        Overrides:
        cancel in class DelegatingStatement
        Throws:
        java.sql.SQLException
      • executeQuery

        protected java.sql.ResultSet executeQuery​(java.lang.String sql,
                                                  boolean wrap)
                                           throws java.sql.SQLException
        Description copied from class: DelegatingStatement
        Execute the query, with the option of not wrapping it in a DelegatingResultSet, which is the default.
        Overrides:
        executeQuery in class DelegatingStatement
        Throws:
        java.sql.SQLException
      • executeUpdate

        public int executeUpdate​(java.lang.String sql)
                          throws java.sql.SQLException
        Specified by:
        executeUpdate in interface java.sql.Statement
        Overrides:
        executeUpdate in class DelegatingStatement
        Throws:
        java.sql.SQLException
      • execute

        public boolean execute​(java.lang.String sql)
                        throws java.sql.SQLException
        Specified by:
        execute in interface java.sql.Statement
        Overrides:
        execute in class DelegatingStatement
        Throws:
        java.sql.SQLException
      • executeUpdate

        public int executeUpdate​(java.lang.String sql,
                                 int i)
                          throws java.sql.SQLException
        Specified by:
        executeUpdate in interface java.sql.Statement
        Overrides:
        executeUpdate in class DelegatingStatement
        Throws:
        java.sql.SQLException
      • executeUpdate

        public int executeUpdate​(java.lang.String sql,
                                 int[] ia)
                          throws java.sql.SQLException
        Specified by:
        executeUpdate in interface java.sql.Statement
        Overrides:
        executeUpdate in class DelegatingStatement
        Throws:
        java.sql.SQLException
      • executeUpdate

        public int executeUpdate​(java.lang.String sql,
                                 java.lang.String[] sa)
                          throws java.sql.SQLException
        Specified by:
        executeUpdate in interface java.sql.Statement
        Overrides:
        executeUpdate in class DelegatingStatement
        Throws:
        java.sql.SQLException
      • execute

        public boolean execute​(java.lang.String sql,
                               int i)
                        throws java.sql.SQLException
        Specified by:
        execute in interface java.sql.Statement
        Overrides:
        execute in class DelegatingStatement
        Throws:
        java.sql.SQLException
      • execute

        public boolean execute​(java.lang.String sql,
                               int[] ia)
                        throws java.sql.SQLException
        Specified by:
        execute in interface java.sql.Statement
        Overrides:
        execute in class DelegatingStatement
        Throws:
        java.sql.SQLException
      • execute

        public boolean execute​(java.lang.String sql,
                               java.lang.String[] sa)
                        throws java.sql.SQLException
        Specified by:
        execute in interface java.sql.Statement
        Overrides:
        execute in class DelegatingStatement
        Throws:
        java.sql.SQLException