Enum DatabricksVendorCode

java.lang.Object
java.lang.Enum<DatabricksVendorCode>
com.databricks.jdbc.exception.DatabricksVendorCode
All Implemented Interfaces:
Serializable, Comparable<DatabricksVendorCode>, java.lang.constant.Constable

public enum DatabricksVendorCode extends Enum<DatabricksVendorCode>
Centralized registry for Databricks JDBC driver vendor error codes. These codes are included in SQLException.getErrorCode() and formatted as: [Databricks][JDBCDriver](vendor_code)
  • Enum Constant Details

    • INCORRECT_UID

      public static final DatabricksVendorCode INCORRECT_UID
      Incorrect or invalid UID parameter provided
    • INCORRECT_ACCESS_TOKEN

      public static final DatabricksVendorCode INCORRECT_ACCESS_TOKEN
      Incorrect or invalid access token provided
    • INCORRECT_HOST

      public static final DatabricksVendorCode INCORRECT_HOST
      Incorrect host URL provided
  • Method Details

    • values

      public static DatabricksVendorCode[] 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

      public static DatabricksVendorCode valueOf(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:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • getCode

      public int getCode()
      Gets the numeric vendor code.
      Returns:
      The vendor error code
    • getMessage

      public String getMessage()
      Gets the error message for this vendor code.
      Returns:
      The error message
    • getUpstreamErrorMessage

      public String getUpstreamErrorMessage()
      Gets the upstream error message for this vendor code.
      Returns:
      The upstream error message, or null if not provided
    • fromCode

      public static DatabricksVendorCode fromCode(int code)
      Finds a vendor code enum by its numeric code.
      Parameters:
      code - The numeric vendor code to search for
      Returns:
      The matching DatabricksVendorCodes enum, or null if not found
    • getVendorCode

      public static int getVendorCode(Throwable throwable)
      Extracts a vendor error code from a throwable by examining the exception chain.
      Parameters:
      throwable - the throwable to analyze, may be null
      Returns:
      the vendor error code if found, or 0 if none detected
    • getVendorCode

      public static int getVendorCode(String exceptionMessage)
      Extracts a vendor error code from an error message string using case-insensitive matching.
      Parameters:
      exceptionMessage - the error message to analyze, may be null
      Returns:
      the vendor error code if found, or 0 if none detected