Class DatabaseException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
ortus.boxlang.runtime.types.exceptions.BoxLangException
ortus.boxlang.runtime.types.exceptions.DatabaseException
- All Implemented Interfaces:
Serializable
This exception is the base exception for all database-related errors in the BoxLang runtime.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionNative error code associated with exception.static final Key
The error message as reported by the database driver.static final Key
The SQL statement sent to the data source.static final Key
SQLState associated with exception.static final Key
If the query uses the queryparam component, query parameter name-value pairs.static final Key
Fields inherited from class ortus.boxlang.runtime.types.exceptions.BoxLangException
detail, detailKey, messageKey, tagContextKey, type, typeKey
-
Constructor Summary
ConstructorsConstructorDescriptionDatabaseException
(String message) ConstructorDatabaseException
(String message, String detail) ConstructorDatabaseException
(String message, String detail, String nativeErrorCode, String SQLState, String SQL, String queryError, String where, Throwable cause) ConstructorDatabaseException
(String message, Throwable cause) Constructor -
Method Summary
Methods inherited from class ortus.boxlang.runtime.types.exceptions.BoxLangException
getDetail, getTagContext, getType
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
NativeErrorCodeKey
-
SQLStateKey
-
SqlKey
-
queryErrorKey
-
whereKey
-
nativeErrorCode
Native error code associated with exception. Database drivers typically provide error codes to diagnose failing database operations. Default value is -1. -
SQLState
SQLState associated with exception. Database drivers typically provide error codes to help diagnose failing database operations. Default value is 1. -
SQL
The SQL statement sent to the data source. -
queryError
The error message as reported by the database driver. -
where
If the query uses the queryparam component, query parameter name-value pairs.
-
-
Constructor Details
-
DatabaseException
Constructor- Parameters:
message
- The message
-
DatabaseException
Constructor- Parameters:
message
- The messagecause
- The cause
-
DatabaseException
Constructor- Parameters:
message
- The messagedetail
- 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 messagedetail
- The detailnativeErrorCode
- The native error codeSQLState
- The SQL stateSQL
- The SQLqueryError
- The query errorwhere
- The wherecause
- The cause
-
-
Method Details
-
getNativeErrorCode
Get the native error code- Returns:
- The native error code
-
getSQLState
Get the SQL state- Returns:
- The SQL state
-
getSQL
Get the SQL- Returns:
- The SQL
-
getQueryError
Get the query error- Returns:
- The query error
-
getWhere
Get the where- Returns:
- The where
-
dataAsStruct
Description copied from class:BoxLangException
Additional data specific to this exception type (doesn't include message, stacktrace, tagcontext, etc)- Overrides:
dataAsStruct
in classBoxLangException
- Returns:
-