Class DatabaseException

All Implemented Interfaces:
Serializable

public class DatabaseException extends BoxLangException
This exception is the base exception for all database-related errors in the BoxLang runtime.
See Also:
  • Field Details

    • NativeErrorCodeKey

      public static final Key NativeErrorCodeKey
    • SQLStateKey

      public static final Key SQLStateKey
    • SqlKey

      public static final Key SqlKey
    • queryErrorKey

      public static final Key queryErrorKey
    • whereKey

      public static final Key whereKey
    • nativeErrorCode

      public String nativeErrorCode
      Native error code associated with exception. Database drivers typically provide error codes to diagnose failing database operations. Default value is -1.
    • SQLState

      public String SQLState
      SQLState associated with exception. Database drivers typically provide error codes to help diagnose failing database operations. Default value is 1.
    • SQL

      public String SQL
      The SQL statement sent to the data source.
    • queryError

      public String queryError
      The error message as reported by the database driver.
    • where

      public String where
      If the query uses the queryparam component, query parameter name-value pairs.
  • Constructor Details

    • DatabaseException

      public DatabaseException(String message)
      Constructor
      Parameters:
      message - The message
    • DatabaseException

      public DatabaseException(String message, Throwable cause)
      Constructor
      Parameters:
      message - The message
      cause - The cause
    • DatabaseException

      public DatabaseException(String message, String detail)
      Constructor
      Parameters:
      message - The message
      detail - The detail
    • DatabaseException

      public DatabaseException(String message, String detail, String nativeErrorCode, String SQLState, String SQL, String queryError, String where, Throwable cause)
      Constructor
      Parameters:
      message - The message
      detail - The detail
      nativeErrorCode - The native error code
      SQLState - The SQL state
      SQL - The SQL
      queryError - The query error
      where - The where
      cause - The cause
  • Method Details

    • getNativeErrorCode

      public String getNativeErrorCode()
      Get the native error code
      Returns:
      The native error code
    • getSQLState

      public String getSQLState()
      Get the SQL state
      Returns:
      The SQL state
    • getSQL

      public String getSQL()
      Get the SQL
      Returns:
      The SQL
    • getQueryError

      public String getQueryError()
      Get the query error
      Returns:
      The query error
    • getWhere

      public String getWhere()
      Get the where
      Returns:
      The where
    • dataAsStruct

      public IStruct dataAsStruct()
      Description copied from class: BoxLangException
      Additional data specific to this exception type (doesn't include message, stacktrace, tagcontext, etc)
      Overrides:
      dataAsStruct in class BoxLangException
      Returns: