org.mariadb.jdbc.internal.util

## Class LogQueryTool

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

    public class LogQueryTool
    extends Object

### Constructor Summary

Constructors
Constructor and Description
`LogQueryTool(Options options)`

### Method Summary

All Methods Instance Methods Concrete Methods
`SQLException` `exceptionWithQuery(ByteBuffer buffer, SQLException sqlEx)` Return exception with query information's.
`SQLException` `exceptionWithQuery(ParameterHolder[] parameters, SQLException sqlEx, PrepareResult serverPrepareResult)` Return exception with query information's.
`SQLException` `exceptionWithQuery(SQLException sqlEx, PrepareResult prepareResult)` Return exception with query information's.
`SQLException` `exceptionWithQuery(String sql, SQLException sqlException)` Return exception with query information's.
`String` `exWithQuery(String message, PrepareResult serverPrepareResult, ParameterHolder[] parameters)` Return exception message with query.
`String` `subQuery(ByteBuffer buffer)` Get query, truncated if to big.
`String` `subQuery(String sql)` Get query, truncated if to big.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### LogQueryTool

    public LogQueryTool(Options options)

### Method Detail

#### subQuery

    public String subQuery(String sql)

Get query, truncated if to big.

Parameters:
  `sql` - current query
Returns:
  possibly truncated query if too big

#### subQuery

    public 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)

Return exception with query information's.

Parameters:
  `sql` - current sql command
  `sqlException` - current exception
Returns:
  exception with query information

#### exceptionWithQuery

    public SQLException exceptionWithQuery(ByteBuffer buffer,
                                           SQLException sqlEx)

Return exception with query information's.

Parameters:
  `buffer` - query buffer
  `sqlEx` - current exception
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

    public 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