Class LogQueryTool

java.lang.Object
org.mariadb.jdbc.internal.util.LogQueryTool

public class LogQueryTool extends Object
  • Field Details

    • options

      private final Options options
  • Constructor Details

    • LogQueryTool

      public LogQueryTool(Options options)
  • Method Details

    • subQuery

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

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

      public SQLException exceptionWithQuery(String 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 SQLException exceptionWithQuery(ByteBuffer buffer, 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 SQLException exceptionWithQuery(ParameterHolder[] parameters, 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 SQLException exceptionWithQuery(SQLException sqlEx, PrepareResult prepareResult)
      Return exception with query information's.
      Parameters:
      sqlEx - current exception
      prepareResult - prepare results
      Returns:
      exception with query information
    • exWithQuery

      private String exWithQuery(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