Package org.mariadb.jdbc.internal.util
Class LogQueryTool
- java.lang.Object
-
- org.mariadb.jdbc.internal.util.LogQueryTool
-
public class LogQueryTool extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description LogQueryTool(Options options)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.sql.SQLExceptionexceptionWithQuery(java.lang.String sql, java.sql.SQLException sqlException, boolean explicitClosed)Return exception with query information's.java.sql.SQLExceptionexceptionWithQuery(java.nio.ByteBuffer buffer, java.sql.SQLException sqlEx, boolean explicitClosed)Return exception with query information's.java.sql.SQLExceptionexceptionWithQuery(java.sql.SQLException sqlEx, PrepareResult prepareResult)Return exception with query information's.java.sql.SQLExceptionexceptionWithQuery(ParameterHolder[] parameters, java.sql.SQLException sqlEx, PrepareResult serverPrepareResult)Return exception with query information's.private java.lang.StringexWithQuery(java.lang.String message, PrepareResult serverPrepareResult, ParameterHolder[] parameters)Return exception message with query.java.lang.StringsubQuery(java.lang.String sql)Get query, truncated if to big.private java.lang.StringsubQuery(java.nio.ByteBuffer buffer)Get query, truncated if to big.
-
-
-
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 commandsqlException- current exceptionexplicitClosed- 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 buffersqlEx- current exceptionexplicitClosed- 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 parameterssqlEx- current exceptionserverPrepareResult- 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 exceptionprepareResult- 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 messageserverPrepareResult- prepare resultparameters- query parameters- Returns:
- exception message with query
-
-