Enum ErrorCode
- All Implemented Interfaces:
Serializable
,Comparable<ErrorCode>
,java.lang.constant.Constable
Error codes in Relational follow the SQLSTATE format wherever possible (to maximize interoperability and ease of understanding). To that end, all error codes are 5-digit codes, where the first 2 characters are the Class of the error, and the remaining 3 characters describe the error itself.
It is important to note that not every error in Relational directly translates to a known standard SQLSTATE code. In those cases, you'll want to look here for the technical definition of those error codes.
The Class codes are as follows:
00 | Success 01 | Warning 02 | No Data 08 | Connection Exception 0A | Unsupported Operation 22 | Data exception 23 | Integrity Constraint Violation 25 | Transaction State 40 | Transaction Rollback 42 | Syntax Error 53 | Insufficient Resources 58 | System Error (errors external to Relational) XX | Internal Error
To add a new Error Code:
First, look at https://en.wikipedia.org/wiki/SQLSTATE to see if the standard has already defined an error code that would be applicable for your purpose. If so, use that one (this means that we are in-line with published SQL codes whenever possible). However, often you'll find that the standard does not have an error code that matches what you're trying to do. In that case, choose a class from the above table, and then define a unique code. Newly introduced error codes follow the pattern "..F..". For example: 08F01
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionUsed for the exceptions due to internal issue of Relational, which is caused by neither clients nor upstream system.Indicates that a schema with the given name is already mapped to a schema template.Used to represent an error that we don't know more details about. -
Method Summary
-
Enum Constant Details
-
SUCCESS
-
NO_RESULT_SET
-
UNABLE_TO_ESTABLISH_SQL_CONNECTION
-
CONNECTION_DOES_NOT_EXIST
-
INVALID_PATH
-
CANNOT_COMMIT_ROLLBACK_WITH_AUTOCOMMIT
-
UNSUPPORTED_OPERATION
-
UNSUPPORTED_QUERY
-
CANNOT_CONVERT_TYPE
-
INVALID_ROW_COUNT_IN_LIMIT_CLAUSE
-
INVALID_PARAMETER
-
ARRAY_ELEMENT_ERROR
-
INVALID_BINARY_REPRESENTATION
-
INVALID_ARGUMENT_FOR_FUNCTION
-
NOT_NULL_VIOLATION
-
UNIQUE_CONSTRAINT_VIOLATION
-
INVALID_CURSOR_STATE
-
INVALID_CONTINUATION
-
INVALID_TRANSACTION_STATE
-
TRANSACTION_INACTIVE
-
SERIALIZATION_FAILURE
-
SYNTAX_OR_ACCESS_VIOLATION
-
INSUFFICIENT_PRIVILEGE
-
SYNTAX_ERROR
-
INVALID_NAME
-
COLUMN_ALREADY_EXISTS
-
AMBIGUOUS_COLUMN
-
UNDEFINED_COLUMN
-
DUPLICATE_ALIAS
-
GROUPING_ERROR
-
DATATYPE_MISMATCH
-
WRONG_OBJECT_TYPE
-
UNDEFINED_DATABASE
-
UNDEFINED_TABLE
-
UNDEFINED_PARAMETER
-
DATABASE_ALREADY_EXISTS
-
SCHEMA_ALREADY_EXISTS
-
TABLE_ALREADY_EXISTS
-
INVALID_COLUMN_REFERENCE
-
INVALID_TABLE_DEFINITION
-
UNKNOWN_TYPE
-
INVALID_RECURSION
-
INCOMPATIBLE_TABLE_ALIAS
-
SCHEMA_MAPPING_ALREADY_EXISTS
Indicates that a schema with the given name is already mapped to a schema template. -
UNDEFINED_SCHEMA
-
UNDEFINED_INDEX
-
UNKNOWN_SCHEMA_TEMPLATE
-
ANNOTATION_ALREADY_EXISTS
-
INDEX_ALREADY_EXISTS
-
INCORRECT_METADATA_TABLE_VERSION
-
INVALID_SCHEMA_TEMPLATE
-
INVALID_PREPARED_STATEMENT_PARAMETER
-
EXECUTE_UPDATE_RETURNED_RESULT_SET
-
DUPLICATE_SCHEMA_TEMPLATE
-
UNKNOWN_DATABASE
-
UNION_INCORRECT_COLUMN_COUNT
-
UNION_INCOMPATIBLE_COLUMNS
-
INVALID_DATABASE
-
TRANSACTION_TIMEOUT
-
TOO_MANY_COLUMNS
-
EXECUTION_LIMIT_REACHED
-
STATEMENT_CLOSED
-
UNDEFINED_FILE
-
UNKNOWN
Used to represent an error that we don't know more details about. This is a backup in case the error handling system can't find a more accurate representation, and shouldn't be used in general. -
INTERNAL_ERROR
Used for the exceptions due to internal issue of Relational, which is caused by neither clients nor upstream system.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
get
-
getErrorCode
-