Package com.pyranid
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
ConstructorDescriptionDatabaseException
(String message) Creates aDatabaseException
with the givenmessage
.DatabaseException
(String message, Throwable cause) Creates aDatabaseException
which wraps the givencause
.DatabaseException
(Throwable cause) Creates aDatabaseException
which 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 aDatabaseException
with the givenmessage
.- Parameters:
message
- a message describing this exception
-
DatabaseException
Creates aDatabaseException
which wraps the givencause
.- Parameters:
cause
- the cause of this exception
-
DatabaseException
Creates aDatabaseException
which 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
- Returns:
- the value of the offending
column
, or empty if not available - Since:
- 1.0.12
-
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
- Returns:
- the value of the offending
detail
, or empty if not available - Since:
- 1.0.12
-
getFile
- Returns:
- the value of the offending
file
, or empty if not available - Since:
- 1.0.12
-
getHint
- Returns:
- the value of the error
hint
, or empty if not available - Since:
- 1.0.12
-
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
- Returns:
- the value of the offending
line
, or empty if not available - Since:
- 1.0.12
-
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
- Returns:
- the value of the offending
schema
, or empty if not available - Since:
- 1.0.12
-
getSeverity
- Returns:
- the error
severity
, or empty if not available - Since:
- 1.0.12
-
getTable
- Returns:
- the value of the offending
table
, or empty if not available - Since:
- 1.0.12
-
getWhere
- Returns:
- the value of the offending
where
, or empty if not available - Since:
- 1.0.12
-