Package com.databricks.jdbc.exception
Enum DatabricksVendorCode
- java.lang.Object
-
- java.lang.Enum<DatabricksVendorCode>
-
- com.databricks.jdbc.exception.DatabricksVendorCode
-
- All Implemented Interfaces:
Serializable,Comparable<DatabricksVendorCode>
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 Summary
Enum Constants Enum Constant Description INCORRECT_ACCESS_TOKENIncorrect or invalid access token providedINCORRECT_HOSTIncorrect host URL providedINCORRECT_UIDIncorrect or invalid UID parameter provided
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DatabricksVendorCodefromCode(int code)Finds a vendor code enum by its numeric code.intgetCode()Gets the numeric vendor code.StringgetMessage()Gets the error message for this vendor code.StringgetUpstreamErrorMessage()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 DatabricksVendorCodevalueOf(String name)Returns 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 Detail
-
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 Detail
-
values
public static DatabricksVendorCode[] 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 (DatabricksVendorCode c : DatabricksVendorCode.values()) System.out.println(c);
- 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 nameNullPointerException- 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
-
-