Package com.mysql.cj.jdbc.exceptions
Class SQLError
java.lang.Object
com.mysql.cj.jdbc.exceptions.SQLError
public class SQLError
extends java.lang.Object
SQLError is a utility class that maps MySQL error codes to SQL error codes as is required by the JDBC spec.
-
Constructor Summary
Constructors Constructor Description SQLError()
-
Method Summary
Modifier and Type Method Description static java.sql.SQLException
createBatchUpdateException(java.sql.SQLException underlyingEx, long[] updateCounts, ExceptionInterceptor interceptor)
Create a BatchUpdateException taking in consideration the JDBC version in use.static java.sql.SQLException
createCommunicationsException(JdbcConnection conn, PacketSentTimeHolder packetSentTimeHolder, PacketReceivedTimeHolder packetReceivedTimeHolder, java.lang.Exception underlyingException, ExceptionInterceptor interceptor)
static java.sql.SQLException
createCommunicationsException(java.lang.String message, java.lang.Throwable underlyingException, ExceptionInterceptor interceptor)
static java.sql.SQLException
createSQLException(java.lang.String message, ExceptionInterceptor interceptor)
static java.sql.SQLException
createSQLException(java.lang.String message, java.lang.String sqlState, int vendorErrorCode, boolean isTransient, ExceptionInterceptor interceptor)
static java.sql.SQLException
createSQLException(java.lang.String message, java.lang.String sqlState, int vendorErrorCode, boolean isTransient, java.lang.Throwable cause, ExceptionInterceptor interceptor)
static java.sql.SQLException
createSQLException(java.lang.String message, java.lang.String sqlState, int vendorErrorCode, ExceptionInterceptor interceptor)
static java.sql.SQLException
createSQLException(java.lang.String message, java.lang.String sqlState, int vendorErrorCode, java.lang.Throwable cause, ExceptionInterceptor interceptor)
static java.sql.SQLException
createSQLException(java.lang.String message, java.lang.String sqlState, ExceptionInterceptor interceptor)
static java.sql.SQLException
createSQLException(java.lang.String message, java.lang.String sqlState, java.lang.Throwable cause, ExceptionInterceptor interceptor)
static java.sql.SQLException
createSQLFeatureNotSupportedException()
Create a SQLFeatureNotSupportedException or a NotImplemented exception according to the JDBC version in use.static java.sql.SQLException
createSQLFeatureNotSupportedException(java.lang.String message, java.lang.String sqlState, ExceptionInterceptor interceptor)
Create a SQLFeatureNotSupportedException or a NotImplemented exception according to the JDBC version in use.
-
Constructor Details
-
SQLError
public SQLError()
-
-
Method Details
-
createSQLException
public static java.sql.SQLException createSQLException(java.lang.String message, java.lang.String sqlState, ExceptionInterceptor interceptor) -
createSQLException
public static java.sql.SQLException createSQLException(java.lang.String message, ExceptionInterceptor interceptor) -
createSQLException
public static java.sql.SQLException createSQLException(java.lang.String message, java.lang.String sqlState, java.lang.Throwable cause, ExceptionInterceptor interceptor) -
createSQLException
public static java.sql.SQLException createSQLException(java.lang.String message, java.lang.String sqlState, int vendorErrorCode, ExceptionInterceptor interceptor) -
createSQLException
public static java.sql.SQLException createSQLException(java.lang.String message, java.lang.String sqlState, int vendorErrorCode, java.lang.Throwable cause, ExceptionInterceptor interceptor) -
createSQLException
public static java.sql.SQLException createSQLException(java.lang.String message, java.lang.String sqlState, int vendorErrorCode, boolean isTransient, ExceptionInterceptor interceptor) -
createSQLException
public static java.sql.SQLException createSQLException(java.lang.String message, java.lang.String sqlState, int vendorErrorCode, boolean isTransient, java.lang.Throwable cause, ExceptionInterceptor interceptor) -
createCommunicationsException
public static java.sql.SQLException createCommunicationsException(JdbcConnection conn, PacketSentTimeHolder packetSentTimeHolder, PacketReceivedTimeHolder packetReceivedTimeHolder, java.lang.Exception underlyingException, ExceptionInterceptor interceptor) -
createCommunicationsException
public static java.sql.SQLException createCommunicationsException(java.lang.String message, java.lang.Throwable underlyingException, ExceptionInterceptor interceptor) -
createBatchUpdateException
public static java.sql.SQLException createBatchUpdateException(java.sql.SQLException underlyingEx, long[] updateCounts, ExceptionInterceptor interceptor) throws java.sql.SQLExceptionCreate a BatchUpdateException taking in consideration the JDBC version in use. For JDBC version prior to 4.2 the updates count array has int elements while JDBC 4.2 and beyond uses long values.- Parameters:
underlyingEx
- underlying exceptionupdateCounts
- update counts of completed queries in this batchinterceptor
- exception interceptor- Returns:
- SQLException
- Throws:
java.sql.SQLException
- if an error occurs
-
createSQLFeatureNotSupportedException
public static java.sql.SQLException createSQLFeatureNotSupportedException()Create a SQLFeatureNotSupportedException or a NotImplemented exception according to the JDBC version in use.- Returns:
- SQLException
-
createSQLFeatureNotSupportedException
public static java.sql.SQLException createSQLFeatureNotSupportedException(java.lang.String message, java.lang.String sqlState, ExceptionInterceptor interceptor) throws java.sql.SQLExceptionCreate a SQLFeatureNotSupportedException or a NotImplemented exception according to the JDBC version in use.- Parameters:
message
- error messagesqlState
- sqlStateinterceptor
- exception interceptor- Returns:
- SQLException
- Throws:
java.sql.SQLException
- if an error occurs
-