public class SQLError
extends java.lang.Object
Constructor and Description |
---|
SQLError() |
Modifier and Type | Method and Description |
---|---|
(package private) static java.sql.SQLWarning |
convertShowWarningsToSQLWarnings(Connection connection)
Turns output of 'SHOW WARNINGS' into JDBC SQLWarning instances.
|
(package private) static java.sql.SQLWarning |
convertShowWarningsToSQLWarnings(Connection connection,
int warningCountIfKnown,
boolean forTruncationOnly)
Turns output of 'SHOW WARNINGS' into JDBC SQLWarning instances.
|
static java.sql.SQLException |
createCommunicationsException(MySQLConnection conn,
long lastPacketSentTimeMs,
long lastPacketReceivedTimeMs,
java.lang.Exception underlyingException,
ExceptionInterceptor interceptor) |
static java.lang.String |
createLinkFailureMessageBasedOnHeuristics(MySQLConnection conn,
long lastPacketSentTimeMs,
long lastPacketReceivedTimeMs,
java.lang.Exception underlyingException,
boolean streamingResultSetInPlay)
Creates a communications link failure message to be used
in CommunicationsException that (hopefully) has some better
information and suggestions based on heuristics.
|
static java.sql.SQLException |
createSQLException(java.lang.String message,
ExceptionInterceptor interceptor) |
static java.sql.SQLException |
createSQLException(java.lang.String message,
ExceptionInterceptor interceptor,
Connection conn) |
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,
int vendorErrorCode,
boolean isTransient,
ExceptionInterceptor interceptor) |
static java.sql.SQLException |
createSQLException(java.lang.String message,
java.lang.String sqlState,
int vendorErrorCode,
boolean isTransient,
ExceptionInterceptor interceptor,
Connection conn) |
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,
java.lang.Throwable cause,
ExceptionInterceptor interceptor) |
static java.sql.SQLException |
createSQLException(java.lang.String message,
java.lang.String sqlState,
java.lang.Throwable cause,
ExceptionInterceptor interceptor,
Connection conn) |
static void |
dumpSqlStatesMappingsAsXml() |
(package private) static java.lang.String |
get(java.lang.String stateCode) |
(package private) static java.lang.String |
mysqlToSqlState(int errno,
boolean useSql92States)
Map MySQL error codes to X/Open or SQL-92 error codes
|
static java.sql.SQLException |
notImplemented() |
static final int ER_WARNING_NOT_COMPLETE_ROLLBACK
public static final java.lang.String SQL_STATE_WARNING
public static final java.lang.String SQL_STATE_DISCONNECT_ERROR
public static final java.lang.String SQL_STATE_DATE_TRUNCATED
public static final java.lang.String SQL_STATE_PRIVILEGE_NOT_REVOKED
public static final java.lang.String SQL_STATE_NO_DATA
public static final java.lang.String SQL_STATE_WRONG_NO_OF_PARAMETERS
public static final java.lang.String SQL_STATE_UNABLE_TO_CONNECT_TO_DATASOURCE
public static final java.lang.String SQL_STATE_CONNECTION_IN_USE
public static final java.lang.String SQL_STATE_CONNECTION_NOT_OPEN
public static final java.lang.String SQL_STATE_CONNECTION_REJECTED
public static final java.lang.String SQL_STATE_CONNECTION_FAILURE
public static final java.lang.String SQL_STATE_TRANSACTION_RESOLUTION_UNKNOWN
public static final java.lang.String SQL_STATE_COMMUNICATION_LINK_FAILURE
public static final java.lang.String SQL_STATE_FEATURE_NOT_SUPPORTED
public static final java.lang.String SQL_STATE_CARDINALITY_VIOLATION
public static final java.lang.String SQL_STATE_INSERT_VALUE_LIST_NO_MATCH_COL_LIST
public static final java.lang.String SQL_STATE_STRING_DATA_RIGHT_TRUNCATION
public static final java.lang.String SQL_STATE_NUMERIC_VALUE_OUT_OF_RANGE
public static final java.lang.String SQL_STATE_INVALID_DATETIME_FORMAT
public static final java.lang.String SQL_STATE_DATETIME_FIELD_OVERFLOW
public static final java.lang.String SQL_STATE_DIVISION_BY_ZERO
public static final java.lang.String SQL_STATE_INVALID_CHARACTER_VALUE_FOR_CAST
public static final java.lang.String SQL_STATE_INTEGRITY_CONSTRAINT_VIOLATION
public static final java.lang.String SQL_STATE_INVALID_CURSOR_STATE
public static final java.lang.String SQL_STATE_INVALID_TRANSACTION_STATE
public static final java.lang.String SQL_STATE_INVALID_AUTH_SPEC
public static final java.lang.String SQL_STATE_INVALID_TRANSACTION_TERMINATION
public static final java.lang.String SQL_STATE_INVALID_CONDITION_NUMBER
public static final java.lang.String SQL_STATE_INVALID_CATALOG_NAME
public static final java.lang.String SQL_STATE_ROLLBACK_SERIALIZATION_FAILURE
public static final java.lang.String SQL_STATE_SYNTAX_ERROR
public static final java.lang.String SQL_STATE_ER_TABLE_EXISTS_ERROR
public static final java.lang.String SQL_STATE_BASE_TABLE_OR_VIEW_NOT_FOUND
public static final java.lang.String SQL_STATE_ER_NO_SUCH_INDEX
public static final java.lang.String SQL_STATE_ER_DUP_FIELDNAME
public static final java.lang.String SQL_STATE_ER_BAD_FIELD_ERROR
public static final java.lang.String SQL_STATE_INVALID_CONNECTION_ATTRIBUTE
public static final java.lang.String SQL_STATE_ERROR_IN_ROW
public static final java.lang.String SQL_STATE_NO_ROWS_UPDATED_OR_DELETED
public static final java.lang.String SQL_STATE_MORE_THAN_ONE_ROW_UPDATED_OR_DELETED
public static final java.lang.String SQL_STATE_RESIGNAL_WHEN_HANDLER_NOT_ACTIVE
public static final java.lang.String SQL_STATE_STACKED_DIAGNOSTICS_ACCESSED_WITHOUT_ACTIVE_HANDLER
public static final java.lang.String SQL_STATE_CASE_NOT_FOUND_FOR_CASE_STATEMENT
public static final java.lang.String SQL_STATE_NULL_VALUE_NOT_ALLOWED
public static final java.lang.String SQL_STATE_INVALID_LOGARITHM_ARGUMENT
public static final java.lang.String SQL_STATE_ACTIVE_SQL_TRANSACTION
public static final java.lang.String SQL_STATE_READ_ONLY_SQL_TRANSACTION
public static final java.lang.String SQL_STATE_SRE_PROHIBITED_SQL_STATEMENT_ATTEMPTED
public static final java.lang.String SQL_STATE_SRE_FUNCTION_EXECUTED_NO_RETURN_STATEMENT
public static final java.lang.String SQL_STATE_DEADLOCK
public static final java.lang.String SQL_STATE_ER_QUERY_INTERRUPTED
public static final java.lang.String SQL_STATE_BASE_TABLE_OR_VIEW_ALREADY_EXISTS
public static final java.lang.String SQL_STATE_BASE_TABLE_NOT_FOUND
public static final java.lang.String SQL_STATE_INDEX_ALREADY_EXISTS
public static final java.lang.String SQL_STATE_INDEX_NOT_FOUND
public static final java.lang.String SQL_STATE_COLUMN_ALREADY_EXISTS
public static final java.lang.String SQL_STATE_COLUMN_NOT_FOUND
public static final java.lang.String SQL_STATE_NO_DEFAULT_FOR_COLUMN
public static final java.lang.String SQL_STATE_GENERAL_ERROR
public static final java.lang.String SQL_STATE_MEMORY_ALLOCATION_FAILURE
public static final java.lang.String SQL_STATE_INVALID_COLUMN_NUMBER
public static final java.lang.String SQL_STATE_ILLEGAL_ARGUMENT
public static final java.lang.String SQL_STATE_DRIVER_NOT_CAPABLE
public static final java.lang.String SQL_STATE_TIMEOUT_EXPIRED
public static final java.lang.String SQL_STATE_CLI_SPECIFIC_CONDITION
public static final java.lang.String SQL_STATE_MEMORY_ALLOCATION_ERROR
public static final java.lang.String SQL_STATE_XA_RBROLLBACK
public static final java.lang.String SQL_STATE_XA_RBDEADLOCK
public static final java.lang.String SQL_STATE_XA_RBTIMEOUT
public static final java.lang.String SQL_STATE_XA_RMERR
public static final java.lang.String SQL_STATE_XAER_NOTA
public static final java.lang.String SQL_STATE_XAER_INVAL
public static final java.lang.String SQL_STATE_XAER_RMFAIL
public static final java.lang.String SQL_STATE_XAER_DUPID
public static final java.lang.String SQL_STATE_XAER_OUTSIDE
static java.sql.SQLWarning convertShowWarningsToSQLWarnings(Connection connection) throws java.sql.SQLException
connection
- the connection to use for getting warnings.java.sql.SQLException
- if the warnings could not be retrievedstatic java.sql.SQLWarning convertShowWarningsToSQLWarnings(Connection connection, int warningCountIfKnown, boolean forTruncationOnly) throws java.sql.SQLException
connection
- the connection to use for getting warnings.warningCountIfKnown
- the warning count (if known), otherwise set it to 0.forTruncationOnly
- if this method should only scan for data truncation warningsjava.sql.SQLException
- if the warnings could not be retrieved, or if data truncation
is being scanned for and truncations were found.public static void dumpSqlStatesMappingsAsXml() throws java.lang.Exception
java.lang.Exception
static java.lang.String get(java.lang.String stateCode)
static java.lang.String mysqlToSqlState(int errno, boolean useSql92States)
errno
- the MySQL error codepublic static java.sql.SQLException createSQLException(java.lang.String message, java.lang.String sqlState, ExceptionInterceptor interceptor)
public static java.sql.SQLException createSQLException(java.lang.String message, ExceptionInterceptor interceptor)
public static java.sql.SQLException createSQLException(java.lang.String message, ExceptionInterceptor interceptor, Connection conn)
public static java.sql.SQLException createSQLException(java.lang.String message, java.lang.String sqlState, java.lang.Throwable cause, ExceptionInterceptor interceptor)
public static java.sql.SQLException createSQLException(java.lang.String message, java.lang.String sqlState, java.lang.Throwable cause, ExceptionInterceptor interceptor, Connection conn)
public static java.sql.SQLException createSQLException(java.lang.String message, java.lang.String sqlState, int vendorErrorCode, ExceptionInterceptor interceptor)
public static java.sql.SQLException createSQLException(java.lang.String message, java.lang.String sqlState, int vendorErrorCode, boolean isTransient, ExceptionInterceptor interceptor)
message
- sqlState
- vendorErrorCode
- isTransient
- interceptor
- public static java.sql.SQLException createSQLException(java.lang.String message, java.lang.String sqlState, int vendorErrorCode, boolean isTransient, ExceptionInterceptor interceptor, Connection conn)
public static java.sql.SQLException createCommunicationsException(MySQLConnection conn, long lastPacketSentTimeMs, long lastPacketReceivedTimeMs, java.lang.Exception underlyingException, ExceptionInterceptor interceptor)
public static java.lang.String createLinkFailureMessageBasedOnHeuristics(MySQLConnection conn, long lastPacketSentTimeMs, long lastPacketReceivedTimeMs, java.lang.Exception underlyingException, boolean streamingResultSetInPlay)
conn
- lastPacketSentTimeMs
- underlyingException
- streamingResultSetInPlay
- public static java.sql.SQLException notImplemented()