Enum ErrorCode

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<ErrorCode>

    public enum ErrorCode
    extends java.lang.Enum<ErrorCode>
    An enumeration form of the different error codes that Relational makes use of.

    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 "..V..". For example: 08F01

    • Enum Constant Detail

      • SUCCESS

        public static final ErrorCode SUCCESS
      • NO_RESULT_SET

        public static final ErrorCode NO_RESULT_SET
      • UNABLE_TO_ESTABLISH_SQL_CONNECTION

        public static final ErrorCode UNABLE_TO_ESTABLISH_SQL_CONNECTION
      • CONNECTION_DOES_NOT_EXIST

        public static final ErrorCode CONNECTION_DOES_NOT_EXIST
      • INVALID_PATH

        public static final ErrorCode INVALID_PATH
      • CANNOT_COMMIT_ROLLBACK_WITH_AUTOCOMMIT

        public static final ErrorCode CANNOT_COMMIT_ROLLBACK_WITH_AUTOCOMMIT
      • UNSUPPORTED_OPERATION

        public static final ErrorCode UNSUPPORTED_OPERATION
      • UNSUPPORTED_QUERY

        public static final ErrorCode UNSUPPORTED_QUERY
      • CANNOT_CONVERT_TYPE

        public static final ErrorCode CANNOT_CONVERT_TYPE
      • INVALID_ROW_COUNT_IN_LIMIT_CLAUSE

        public static final ErrorCode INVALID_ROW_COUNT_IN_LIMIT_CLAUSE
      • INVALID_PARAMETER

        public static final ErrorCode INVALID_PARAMETER
      • ARRAY_ELEMENT_ERROR

        public static final ErrorCode ARRAY_ELEMENT_ERROR
      • INVALID_BINARY_REPRESENTATION

        public static final ErrorCode INVALID_BINARY_REPRESENTATION
      • INVALID_ARGUMENT_FOR_FUNCTION

        public static final ErrorCode INVALID_ARGUMENT_FOR_FUNCTION
      • NOT_NULL_VIOLATION

        public static final ErrorCode NOT_NULL_VIOLATION
      • UNIQUE_CONSTRAINT_VIOLATION

        public static final ErrorCode UNIQUE_CONSTRAINT_VIOLATION
      • INVALID_CURSOR_STATE

        public static final ErrorCode INVALID_CURSOR_STATE
      • INVALID_CONTINUATION

        public static final ErrorCode INVALID_CONTINUATION
      • INVALID_TRANSACTION_STATE

        public static final ErrorCode INVALID_TRANSACTION_STATE
      • TRANSACTION_INACTIVE

        public static final ErrorCode TRANSACTION_INACTIVE
      • SERIALIZATION_FAILURE

        public static final ErrorCode SERIALIZATION_FAILURE
      • SYNTAX_OR_ACCESS_VIOLATION

        public static final ErrorCode SYNTAX_OR_ACCESS_VIOLATION
      • INSUFFICIENT_PRIVILEGE

        public static final ErrorCode INSUFFICIENT_PRIVILEGE
      • SYNTAX_ERROR

        public static final ErrorCode SYNTAX_ERROR
      • INVALID_NAME

        public static final ErrorCode INVALID_NAME
      • COLUMN_ALREADY_EXISTS

        public static final ErrorCode COLUMN_ALREADY_EXISTS
      • AMBIGUOUS_COLUMN

        public static final ErrorCode AMBIGUOUS_COLUMN
      • UNDEFINED_COLUMN

        public static final ErrorCode UNDEFINED_COLUMN
      • DUPLICATE_ALIAS

        public static final ErrorCode DUPLICATE_ALIAS
      • GROUPING_ERROR

        public static final ErrorCode GROUPING_ERROR
      • DATATYPE_MISMATCH

        public static final ErrorCode DATATYPE_MISMATCH
      • WRONG_OBJECT_TYPE

        public static final ErrorCode WRONG_OBJECT_TYPE
      • UNDEFINED_DATABASE

        public static final ErrorCode UNDEFINED_DATABASE
      • UNDEFINED_TABLE

        public static final ErrorCode UNDEFINED_TABLE
      • UNDEFINED_PARAMETER

        public static final ErrorCode UNDEFINED_PARAMETER
      • DATABASE_ALREADY_EXISTS

        public static final ErrorCode DATABASE_ALREADY_EXISTS
      • SCHEMA_ALREADY_EXISTS

        public static final ErrorCode SCHEMA_ALREADY_EXISTS
      • TABLE_ALREADY_EXISTS

        public static final ErrorCode TABLE_ALREADY_EXISTS
      • INVALID_COLUMN_REFERENCE

        public static final ErrorCode INVALID_COLUMN_REFERENCE
      • INVALID_TABLE_DEFINITION

        public static final ErrorCode INVALID_TABLE_DEFINITION
      • UNKNOWN_TYPE

        public static final ErrorCode UNKNOWN_TYPE
      • INVALID_RECURSION

        public static final ErrorCode INVALID_RECURSION
      • SCHEMA_MAPPING_ALREADY_EXISTS

        public static final ErrorCode SCHEMA_MAPPING_ALREADY_EXISTS
        Indicates that a schema with the given name is already mapped to a schema template.
      • UNDEFINED_SCHEMA

        public static final ErrorCode UNDEFINED_SCHEMA
      • UNDEFINED_INDEX

        public static final ErrorCode UNDEFINED_INDEX
      • UNKNOWN_SCHEMA_TEMPLATE

        public static final ErrorCode UNKNOWN_SCHEMA_TEMPLATE
      • ANNOTATION_ALREADY_EXISTS

        public static final ErrorCode ANNOTATION_ALREADY_EXISTS
      • INDEX_ALREADY_EXISTS

        public static final ErrorCode INDEX_ALREADY_EXISTS
      • INCORRECT_METADATA_TABLE_VERSION

        public static final ErrorCode INCORRECT_METADATA_TABLE_VERSION
      • INVALID_SCHEMA_TEMPLATE

        public static final ErrorCode INVALID_SCHEMA_TEMPLATE
      • INVALID_PREPARED_STATEMENT_PARAMETER

        public static final ErrorCode INVALID_PREPARED_STATEMENT_PARAMETER
      • EXECUTE_UPDATE_RETURNED_RESULT_SET

        public static final ErrorCode EXECUTE_UPDATE_RETURNED_RESULT_SET
      • DUPLICATE_SCHEMA_TEMPLATE

        public static final ErrorCode DUPLICATE_SCHEMA_TEMPLATE
      • UNKNOWN_DATABASE

        public static final ErrorCode UNKNOWN_DATABASE
      • UNION_INCORRECT_COLUMN_COUNT

        public static final ErrorCode UNION_INCORRECT_COLUMN_COUNT
      • UNION_INCOMPATIBLE_COLUMNS

        public static final ErrorCode UNION_INCOMPATIBLE_COLUMNS
      • INVALID_DATABASE

        public static final ErrorCode INVALID_DATABASE
      • TRANSACTION_TIMEOUT

        public static final ErrorCode TRANSACTION_TIMEOUT
      • TOO_MANY_COLUMNS

        public static final ErrorCode TOO_MANY_COLUMNS
      • EXECUTION_LIMIT_REACHED

        public static final ErrorCode EXECUTION_LIMIT_REACHED
      • STATEMENT_CLOSED

        public static final ErrorCode STATEMENT_CLOSED
      • UNDEFINED_FILE

        public static final ErrorCode UNDEFINED_FILE
      • UNKNOWN

        public static final ErrorCode 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

        public static final ErrorCode INTERNAL_ERROR
        Used for the exceptions due to internal issue of Relational, which is caused by neither clients nor upstream system.
    • Method Detail

      • values

        public static ErrorCode[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (ErrorCode c : ErrorCode.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static ErrorCode valueOf​(java.lang.String name)
        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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • get

        public static ErrorCode get​(java.lang.String errorCode)
      • getErrorCode

        public java.lang.String getErrorCode()