类 SQLError
- java.lang.Object
-
- com.mysql.cj.jdbc.exceptions.SQLError
-
public class SQLError extends Object
SQLError is a utility class that maps MySQL error codes to SQL error codes as is required by the JDBC spec.
-
-
构造器概要
构造器 构造器 说明 SQLError()
-
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 static SQLExceptioncreateBatchUpdateException(SQLException underlyingEx, long[] updateCounts, ExceptionInterceptor interceptor)Create a BatchUpdateException taking in consideration the JDBC version in use.static SQLExceptioncreateCommunicationsException(JdbcConnection conn, PacketSentTimeHolder packetSentTimeHolder, PacketReceivedTimeHolder packetReceivedTimeHolder, Exception underlyingException, ExceptionInterceptor interceptor)static SQLExceptioncreateCommunicationsException(String message, Throwable underlyingException, ExceptionInterceptor interceptor)static SQLExceptioncreateSQLException(String message, ExceptionInterceptor interceptor)static SQLExceptioncreateSQLException(String message, String sqlState, int vendorErrorCode, boolean isTransient, ExceptionInterceptor interceptor)static SQLExceptioncreateSQLException(String message, String sqlState, int vendorErrorCode, boolean isTransient, Throwable cause, ExceptionInterceptor interceptor)static SQLExceptioncreateSQLException(String message, String sqlState, int vendorErrorCode, ExceptionInterceptor interceptor)static SQLExceptioncreateSQLException(String message, String sqlState, int vendorErrorCode, Throwable cause, ExceptionInterceptor interceptor)static SQLExceptioncreateSQLException(String message, String sqlState, ExceptionInterceptor interceptor)static SQLExceptioncreateSQLException(String message, String sqlState, Throwable cause, ExceptionInterceptor interceptor)static SQLExceptioncreateSQLFeatureNotSupportedException()Create a SQLFeatureNotSupportedException or a NotImplemented exception according to the JDBC version in use.static SQLExceptioncreateSQLFeatureNotSupportedException(String message, String sqlState, ExceptionInterceptor interceptor)Create a SQLFeatureNotSupportedException or a NotImplemented exception according to the JDBC version in use.
-
-
-
方法详细资料
-
createSQLException
public static SQLException createSQLException(String message, String sqlState, ExceptionInterceptor interceptor)
-
createSQLException
public static SQLException createSQLException(String message, ExceptionInterceptor interceptor)
-
createSQLException
public static SQLException createSQLException(String message, String sqlState, Throwable cause, ExceptionInterceptor interceptor)
-
createSQLException
public static SQLException createSQLException(String message, String sqlState, int vendorErrorCode, ExceptionInterceptor interceptor)
-
createSQLException
public static SQLException createSQLException(String message, String sqlState, int vendorErrorCode, Throwable cause, ExceptionInterceptor interceptor)
-
createSQLException
public static SQLException createSQLException(String message, String sqlState, int vendorErrorCode, boolean isTransient, ExceptionInterceptor interceptor)
-
createSQLException
public static SQLException createSQLException(String message, String sqlState, int vendorErrorCode, boolean isTransient, Throwable cause, ExceptionInterceptor interceptor)
-
createCommunicationsException
public static SQLException createCommunicationsException(JdbcConnection conn, PacketSentTimeHolder packetSentTimeHolder, PacketReceivedTimeHolder packetReceivedTimeHolder, Exception underlyingException, ExceptionInterceptor interceptor)
-
createCommunicationsException
public static SQLException createCommunicationsException(String message, Throwable underlyingException, ExceptionInterceptor interceptor)
-
createBatchUpdateException
public static SQLException createBatchUpdateException(SQLException underlyingEx, long[] updateCounts, ExceptionInterceptor interceptor) throws SQLException
Create 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.- 参数:
underlyingEx- underlying exceptionupdateCounts- update counts of completed queries in this batchinterceptor- exception interceptor- 返回:
- SQLException
- 抛出:
SQLException- if an error occurs
-
createSQLFeatureNotSupportedException
public static SQLException createSQLFeatureNotSupportedException()
Create a SQLFeatureNotSupportedException or a NotImplemented exception according to the JDBC version in use.- 返回:
- SQLException
-
createSQLFeatureNotSupportedException
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.- 参数:
message- error messagesqlState- sqlStateinterceptor- exception interceptor- 返回:
- SQLException
- 抛出:
SQLException- if an error occurs
-
-