Class AdbcException

java.lang.Object
java.lang.Throwable
java.lang.Exception
org.apache.arrow.adbc.core.AdbcException
All Implemented Interfaces:
Serializable

public class AdbcException extends Exception
An error in the database or ADBC driver.

The exception contains up to five types of information about the error:

  • An error message
  • An exception cause
  • An ADBC status code
  • A SQLSTATE string
  • A vendor-specific status code
See Also:
  • Constructor Details

  • Method Details

    • invalidArgument

      public static AdbcException invalidArgument(String message)
      Create a new exception with code AdbcStatusCode.INVALID_ARGUMENT.
    • io

      public static AdbcException io(String message)
      Create a new exception with code AdbcStatusCode.IO.
    • invalidState

      public static AdbcException invalidState(String message)
      Create a new exception with code AdbcStatusCode.INVALID_STATE.
    • notImplemented

      public static AdbcException notImplemented(String message)
      Create a new exception with code AdbcStatusCode.NOT_IMPLEMENTED.
    • getStatus

      public AdbcStatusCode getStatus()
      The ADBC status code.
    • getSqlState

      public @Nullable String getSqlState()
      A SQLSTATE error code, if provided, as defined by the SQL:2003 standard.
    • getVendorCode

      public int getVendorCode()
      A vendor-specific error code, if applicable.
    • getDetails

      public Collection<ErrorDetail> getDetails()
      Get extra driver-specific error details.

      This allows drivers to return custom, structured error information (for example, JSON or Protocol Buffers) that can be optionally parsed by clients, beyond the standard AdbcError fields, without having to encode it in the error message. The encoding of the data is driver-defined.

    • withCause

      public AdbcException withCause(Throwable cause)
      Copy this exception with a different cause (a convenience for use with the static factories).
    • withDetails

      public AdbcException withDetails(Collection<ErrorDetail> details)
      Copy this exception with different details (a convenience for use with the static factories).
    • toString

      public String toString()
      Overrides:
      toString in class Throwable