public class ExceptionMapper extends Object
Constructor and Description |
---|
ExceptionMapper() |
Modifier and Type | Method and Description |
---|---|
static void |
checkConnectionException(SQLException exception,
MariaDbConnection connection)
Check connection exception to report to poolConnection listeners.
|
static SQLException |
connException(String message) |
static SQLException |
connException(String message,
Throwable cause) |
static SQLException |
get(String message,
String sqlState,
int errorCode,
Throwable exception,
boolean timeout)
Helper to decorate exception with associate subclass of
SQLException exception. |
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 |
throwException(SQLException exception,
MariaDbConnection connection,
MariaDbStatement statement)
Helper to throw exception.
|
public static void throwException(SQLException exception, MariaDbConnection connection, MariaDbStatement statement) throws SQLException
exception
- exceptionconnection
- current connectionstatement
- current statementSQLException
- exceptionpublic static SQLException connException(String message)
public static SQLException connException(String message, Throwable cause)
public static SQLException getException(SQLException exception, MariaDbConnection connection, MariaDbStatement statement, boolean timeout)
SQLException
exception.exception
- exceptionconnection
- current connectionstatement
- current statementtimeout
- was timeout on querypublic static void checkConnectionException(SQLException exception, MariaDbConnection connection)
exception
- current exceptionconnection
- current connectionpublic static SQLException get(String message, String sqlState, int errorCode, Throwable exception, boolean timeout)
SQLException
exception.message
- exception messagesqlState
- sqlstateerrorCode
- errorCodeexception
- causetimeout
- 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.