Class LogQueryTool


  • public class LogQueryTool
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private Options options  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.sql.SQLException exceptionWithQuery​(java.lang.String sql, java.sql.SQLException sqlException, boolean explicitClosed)
      Return exception with query information's.
      java.sql.SQLException exceptionWithQuery​(java.nio.ByteBuffer buffer, java.sql.SQLException sqlEx, boolean explicitClosed)
      Return exception with query information's.
      java.sql.SQLException exceptionWithQuery​(java.sql.SQLException sqlEx, PrepareResult prepareResult)
      Return exception with query information's.
      java.sql.SQLException exceptionWithQuery​(ParameterHolder[] parameters, java.sql.SQLException sqlEx, PrepareResult serverPrepareResult)
      Return exception with query information's.
      private java.lang.String exWithQuery​(java.lang.String message, PrepareResult serverPrepareResult, ParameterHolder[] parameters)
      Return exception message with query.
      java.lang.String subQuery​(java.lang.String sql)
      Get query, truncated if to big.
      private java.lang.String subQuery​(java.nio.ByteBuffer buffer)
      Get query, truncated if to big.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • options

        private final Options options
    • Constructor Detail

      • LogQueryTool

        public LogQueryTool​(Options options)
    • Method Detail

      • subQuery

        public java.lang.String subQuery​(java.lang.String sql)
        Get query, truncated if to big.
        Parameters:
        sql - current query
        Returns:
        possibly truncated query if too big
      • subQuery

        private java.lang.String subQuery​(java.nio.ByteBuffer buffer)
        Get query, truncated if to big.
        Parameters:
        buffer - current query buffer
        Returns:
        possibly truncated query if too big
      • exceptionWithQuery

        public java.sql.SQLException exceptionWithQuery​(java.lang.String sql,
                                                        java.sql.SQLException sqlException,
                                                        boolean explicitClosed)
        Return exception with query information's.
        Parameters:
        sql - current sql command
        sqlException - current exception
        explicitClosed - has connection been explicitly closed
        Returns:
        exception with query information
      • exceptionWithQuery

        public java.sql.SQLException exceptionWithQuery​(java.nio.ByteBuffer buffer,
                                                        java.sql.SQLException sqlEx,
                                                        boolean explicitClosed)
        Return exception with query information's.
        Parameters:
        buffer - query buffer
        sqlEx - current exception
        explicitClosed - has connection been explicitly closed
        Returns:
        exception with query information
      • exceptionWithQuery

        public java.sql.SQLException exceptionWithQuery​(ParameterHolder[] parameters,
                                                        java.sql.SQLException sqlEx,
                                                        PrepareResult serverPrepareResult)
        Return exception with query information's.
        Parameters:
        parameters - query parameters
        sqlEx - current exception
        serverPrepareResult - prepare results
        Returns:
        exception with query information
      • exceptionWithQuery

        public java.sql.SQLException exceptionWithQuery​(java.sql.SQLException sqlEx,
                                                        PrepareResult prepareResult)
        Return exception with query information's.
        Parameters:
        sqlEx - current exception
        prepareResult - prepare results
        Returns:
        exception with query information
      • exWithQuery

        private java.lang.String exWithQuery​(java.lang.String message,
                                             PrepareResult serverPrepareResult,
                                             ParameterHolder[] parameters)
        Return exception message with query.
        Parameters:
        message - current exception message
        serverPrepareResult - prepare result
        parameters - query parameters
        Returns:
        exception message with query