Top Description Constructors Methods
com.mysql.cj.jdbc.exceptions

public Class SQLError

extends Object
Class Inheritance
Imports
java.sql.BatchUpdateException, .SQLDataException, .SQLException, .SQLFeatureNotSupportedException, .SQLIntegrityConstraintViolationException, .SQLNonTransientConnectionException, .SQLSyntaxErrorException, .SQLTransientConnectionException, com.mysql.cj.exceptions.ExceptionInterceptor, .MysqlErrorNumbers, com.mysql.cj.jdbc.JdbcConnection, com.mysql.cj.protocol.PacketReceivedTimeHolder, .PacketSentTimeHolder, com.mysql.cj.util.Util

SQLError is a utility class that maps MySQL error codes to SQL error codes as is required by the JDBC spec.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static SQLException

Returns:

SQLException
createBatchUpdateException
(SQLException
underlying exception
underlyingEx
,
long[]
update counts of completed queries in this batch
updateCounts
,
ExceptionInterceptor
exception interceptor
interceptor
)

Create a BatchUpdateException.

public static SQLException
createCommunicationsException(JdbcConnection conn, PacketSentTimeHolder packetSentTimeHolder, PacketReceivedTimeHolder packetReceivedTimeHolder, Exception underlyingException, ExceptionInterceptor interceptor)

public static SQLException
createCommunicationsException(String message, Throwable underlyingException, ExceptionInterceptor interceptor)

public static SQLException
createSQLException(String message, String sqlState, ExceptionInterceptor interceptor)

public static SQLException
public static SQLException
createSQLException(String message, String sqlState, Throwable cause, ExceptionInterceptor interceptor)

public static SQLException
createSQLException(String message, String sqlState, int vendorErrorCode, ExceptionInterceptor interceptor)

public static SQLException
createSQLException(String message, String sqlState, int vendorErrorCode, Throwable cause, ExceptionInterceptor interceptor)

public static SQLException
createSQLException(String message, String sqlState, int vendorErrorCode, boolean isTransient, ExceptionInterceptor interceptor)

public static SQLException
createSQLException(String message, String sqlState, int vendorErrorCode, boolean isTransient, Throwable cause, ExceptionInterceptor interceptor)

public static SQLException

Returns:

SQLException
createSQLFeatureNotSupportedException
()

Create a SQLFeatureNotSupportedException or a NotImplemented exception according to the JDBC version in use.

public static SQLException

Returns:

SQLException
createSQLFeatureNotSupportedException
(String
error message
message
,
String
sqlState
sqlState
,
ExceptionInterceptor
exception interceptor
interceptor
)

Create a SQLFeatureNotSupportedException or a NotImplemented exception according to the JDBC version in use.

private static SQLException

Returns:

SQLException
runThroughExceptionInterceptor
(ExceptionInterceptor
exception interceptor
exInterceptor
,
SQLException
cause
sqlEx
)

Run exception through an ExceptionInterceptor chain.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

SQLErrorback to summary
public SQLError()

Method Detail

createBatchUpdateExceptionback to summary
public static SQLException createBatchUpdateException(SQLException underlyingEx, long[] updateCounts, ExceptionInterceptor interceptor) throws SQLException

Create a BatchUpdateException.

Parameters
underlyingEx:SQLException

underlying exception

updateCounts:long[]

update counts of completed queries in this batch

interceptor:ExceptionInterceptor

exception interceptor

Returns:SQLException

SQLException

Exceptions
SQLException:
if an error occurs
createCommunicationsExceptionback to summary
public static SQLException createCommunicationsException(JdbcConnection conn, PacketSentTimeHolder packetSentTimeHolder, PacketReceivedTimeHolder packetReceivedTimeHolder, Exception underlyingException, ExceptionInterceptor interceptor)
createCommunicationsExceptionback to summary
public static SQLException createCommunicationsException(String message, Throwable underlyingException, ExceptionInterceptor interceptor)
createSQLExceptionback to summary
public static SQLException createSQLException(String message, String sqlState, ExceptionInterceptor interceptor)
createSQLExceptionback to summary
public static SQLException createSQLException(String message, ExceptionInterceptor interceptor)
createSQLExceptionback to summary
public static SQLException createSQLException(String message, String sqlState, Throwable cause, ExceptionInterceptor interceptor)
createSQLExceptionback to summary
public static SQLException createSQLException(String message, String sqlState, int vendorErrorCode, ExceptionInterceptor interceptor)
createSQLExceptionback to summary
public static SQLException createSQLException(String message, String sqlState, int vendorErrorCode, Throwable cause, ExceptionInterceptor interceptor)
createSQLExceptionback to summary
public static SQLException createSQLException(String message, String sqlState, int vendorErrorCode, boolean isTransient, ExceptionInterceptor interceptor)
createSQLExceptionback to summary
public static SQLException createSQLException(String message, String sqlState, int vendorErrorCode, boolean isTransient, Throwable cause, ExceptionInterceptor interceptor)
createSQLFeatureNotSupportedExceptionback to summary
public static SQLException createSQLFeatureNotSupportedException()

Create a SQLFeatureNotSupportedException or a NotImplemented exception according to the JDBC version in use.

Returns:SQLException

SQLException

createSQLFeatureNotSupportedExceptionback to summary
public static SQLException createSQLFeatureNotSupportedException(String message, String sqlState, ExceptionInterceptor interceptor) throws SQLException

Create a SQLFeatureNotSupportedException or a NotImplemented exception according to the JDBC version in use.

Parameters
message:String

error message

sqlState:String

sqlState

interceptor:ExceptionInterceptor

exception interceptor

Returns:SQLException

SQLException

Exceptions
SQLException:
if an error occurs
runThroughExceptionInterceptorback to summary
private static SQLException runThroughExceptionInterceptor(ExceptionInterceptor exInterceptor, SQLException sqlEx)

Run exception through an ExceptionInterceptor chain.

Parameters
exInterceptor:ExceptionInterceptor

exception interceptor

sqlEx:SQLException

cause

Returns:SQLException

SQLException