Enum DatabricksVendorCode
- All Implemented Interfaces:
Serializable,Comparable<DatabricksVendorCode>,java.lang.constant.Constable
Centralized registry for Databricks JDBC driver vendor error codes. These codes are included in
SQLException.getErrorCode() and formatted as: [Databricks][JDBCDriver](vendor_code)
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionIncorrect or invalid access token providedIncorrect host URL providedIncorrect or invalid UID parameter provided -
Method Summary
Modifier and TypeMethodDescriptionstatic DatabricksVendorCodefromCode(int code) Finds a vendor code enum by its numeric code.intgetCode()Gets the numeric vendor code.Gets the error message for this vendor code.Gets the upstream error message for this vendor code.static intgetVendorCode(String exceptionMessage) Extracts a vendor error code from an error message string using case-insensitive matching.static intgetVendorCode(Throwable throwable) Extracts a vendor error code from a throwable by examining the exception chain.static DatabricksVendorCodeReturns the enum constant of this type with the specified name.static DatabricksVendorCode[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
INCORRECT_UID
Incorrect or invalid UID parameter provided -
INCORRECT_ACCESS_TOKEN
Incorrect or invalid access token provided -
INCORRECT_HOST
Incorrect host URL provided
-
-
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
-
getCode
public int getCode()Gets the numeric vendor code.- Returns:
- The vendor error code
-
getMessage
-
getUpstreamErrorMessage
Gets the upstream error message for this vendor code.- Returns:
- The upstream error message, or null if not provided
-
fromCode
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
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
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
-