Class ResultSetLogger

  • All Implemented Interfaces:
    java.lang.reflect.InvocationHandler

    public final class ResultSetLogger
    extends BaseJdbcLogger
    implements java.lang.reflect.InvocationHandler
    ResultSet proxy to add logging.
    • Field Detail

      • BLOB_TYPES

        private static final java.util.Set<java.lang.Integer> BLOB_TYPES
      • first

        private boolean first
      • rows

        private int rows
      • rs

        private final java.sql.ResultSet rs
      • blobColumns

        private final java.util.Set<java.lang.Integer> blobColumns
    • Constructor Detail

      • ResultSetLogger

        private ResultSetLogger​(java.sql.ResultSet rs,
                                Log statementLog,
                                int queryStack)
    • Method Detail

      • invoke

        public java.lang.Object invoke​(java.lang.Object proxy,
                                       java.lang.reflect.Method method,
                                       java.lang.Object[] params)
                                throws java.lang.Throwable
        Specified by:
        invoke in interface java.lang.reflect.InvocationHandler
        Throws:
        java.lang.Throwable
      • printColumnHeaders

        private void printColumnHeaders​(java.sql.ResultSetMetaData rsmd,
                                        int columnCount)
                                 throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • printColumnValues

        private void printColumnValues​(int columnCount)
      • newInstance

        public static java.sql.ResultSet newInstance​(java.sql.ResultSet rs,
                                                     Log statementLog,
                                                     int queryStack)
        Creates a logging version of a ResultSet.
        Parameters:
        rs - the ResultSet to proxy
        statementLog - the statement log
        queryStack - the query stack
        Returns:
        the ResultSet with logging
      • getRs

        public java.sql.ResultSet getRs()
        Get the wrapped result set.
        Returns:
        the resultSet