public class ExceptionMapper extends Object
Constructor and Description |
---|
ExceptionMapper() |
Modifier and Type | Method and Description |
---|---|
static SQLException |
getException(SQLException exception,
MariaDbConnection connection,
MariaDbStatement statement,
boolean timeout)
Helper to decorate exception with associate subclass of
SQLException exception. |
static SQLException |
getFeatureNotSupportedException(String message) |
static SQLException |
getSqlException(String message) |
static SQLException |
getSqlException(String message,
Exception exception) |
static SQLException |
getSqlException(String message,
String sqlState,
Exception exception) |
static String |
mapCodeToSqlState(int code)
Mapp code to State.
|
static void |
throwAndLogException(SQLException exception,
MariaDbConnection connection,
MariaDbStatement statement,
Logger logger,
boolean timeout)
Helper to throw exception.
|
static void |
throwException(SQLException exception,
MariaDbConnection connection,
MariaDbStatement statement)
Helper to throw exception.
|
public static void throwAndLogException(SQLException exception, MariaDbConnection connection, MariaDbStatement statement, Logger logger, boolean timeout) throws SQLException
exception
- exceptionconnection
- current connectionstatement
- current statementlogger
- loggertimeout
- was timeout on querySQLException
- exceptionpublic static void throwException(SQLException exception, MariaDbConnection connection, MariaDbStatement statement) throws SQLException
exception
- exceptionconnection
- current connectionstatement
- current statementSQLException
- exceptionpublic static SQLException getException(SQLException exception, MariaDbConnection connection, MariaDbStatement statement, boolean timeout)
SQLException
exception.exception
- exceptionconnection
- current connectionstatement
- current statementtimeout
- was timeout on querypublic static SQLException getSqlException(String message, Exception exception)
public static SQLException getSqlException(String message, String sqlState, Exception exception)
public static SQLException getSqlException(String message)
public static SQLException getFeatureNotSupportedException(String message)
public static String mapCodeToSqlState(int code)
code
- codeCopyright © 2017. All rights reserved.