Class ExceptionMapper
java.lang.Object
org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic 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
Helper to decorate exception with associate subclass ofSQLException
exception.static SQLException
getException
(SQLException exception, MariaDbConnection connection, MariaDbStatement statement, boolean timeout) Helper to decorate exception with associate subclass ofSQLException
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.
-
Field Details
-
LOCK_DEADLOCK_ERROR_CODES
-
-
Constructor Details
-
ExceptionMapper
public ExceptionMapper()
-
-
Method Details
-
throwException
public static void throwException(SQLException exception, MariaDbConnection connection, MariaDbStatement statement) throws SQLException Helper to throw exception.- Parameters:
exception
- exceptionconnection
- current connectionstatement
- current statement- Throws:
SQLException
- exception
-
connException
-
connException
-
getException
public static SQLException getException(SQLException exception, MariaDbConnection connection, MariaDbStatement statement, boolean timeout) Helper to decorate exception with associate subclass ofSQLException
exception.- Parameters:
exception
- exceptionconnection
- current connectionstatement
- current statementtimeout
- was timeout on query- Returns:
- SQLException exception
-
checkConnectionException
Check connection exception to report to poolConnection listeners.- Parameters:
exception
- current exceptionconnection
- current connection
-
get
public static SQLException get(String message, String sqlState, int errorCode, Throwable exception, boolean timeout) Helper to decorate exception with associate subclass ofSQLException
exception.- Parameters:
message
- exception messagesqlState
- sqlstateerrorCode
- errorCodeexception
- causetimeout
- was timeout on query- Returns:
- SQLException exception
-
getSqlException
-
getSqlException
-
getSqlException
-
getFeatureNotSupportedException
-
mapCodeToSqlState
Mapp code to State.- Parameters:
code
- code- Returns:
- String
-