Class DatabaseException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.pyranid.DatabaseException
- All Implemented Interfaces:
Serializable
Thrown when an error occurs when interacting with a
Database.
If the cause of this exception is a SQLException, the getErrorCode() and getSqlState()
accessors are shorthand for retrieving the corresponding SQLException values.
- Since:
- 1.0.0
- Author:
- Mark Allen
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDatabaseException(String message) Creates aDatabaseExceptionwith the givenmessage.DatabaseException(String message, Throwable cause) Creates aDatabaseExceptionwhich wraps the givencause.DatabaseException(Throwable cause) Creates aDatabaseExceptionwhich wraps the givencause. -
Method Summary
Modifier and TypeMethodDescriptionShorthand forSQLException.getErrorCode()if this exception was caused by aSQLException.getFile()getHint()getLine()Shorthand forSQLException.getSQLState()if this exception was caused by aSQLException.getTable()getWhere()toString()Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
-
Constructor Details
-
DatabaseException
Creates aDatabaseExceptionwith the givenmessage.- Parameters:
message- a message describing this exception
-
DatabaseException
Creates aDatabaseExceptionwhich wraps the givencause.- Parameters:
cause- the cause of this exception
-
DatabaseException
Creates aDatabaseExceptionwhich wraps the givencause.- Parameters:
message- a message describing this exceptioncause- the cause of this exception
-
-
Method Details
-
toString
-
getErrorCode
Shorthand forSQLException.getErrorCode()if this exception was caused by aSQLException.- Returns:
- the value of
SQLException.getErrorCode(), or empty if not available
-
getSqlState
Shorthand forSQLException.getSQLState()if this exception was caused by aSQLException.- Returns:
- the value of
SQLException.getSQLState(), or empty if not available
-
getColumn
-
getConstraint
- Returns:
- the value of the offending
constraint, or empty if not available - Since:
- 1.0.12
-
getDatatype
- Returns:
- the value of the offending
datatype, or empty if not available - Since:
- 1.0.12
-
getDetail
-
getFile
-
getHint
-
getInternalPosition
- Returns:
- the value of the offending
internalPosition, or empty if not available - Since:
- 1.0.12
-
getInternalQuery
- Returns:
- the value of the offending
internalQuery, or empty if not available - Since:
- 1.0.12
-
getLine
-
getDbmsMessage
- Returns:
- the value of the error
dbmsMessage, or empty if not available - Since:
- 1.0.12
-
getPosition
- Returns:
- the value of the offending
position, or empty if not available - Since:
- 1.0.12
-
getRoutine
- Returns:
- the value of the offending
routine, or empty if not available - Since:
- 1.0.12
-
getSchema
-
getSeverity
- Returns:
- the error
severity, or empty if not available - Since:
- 1.0.12
-
getTable
-
getWhere
-