public class DataAccessException
extends java.lang.RuntimeException
DataAccessException
is a generic RuntimeException
indicating that something went wrong while executing a SQL statement from
jOOQ. The idea behind this unchecked exception is borrowed from Spring's
JDBC's DataAccessExceptionConstructor and Description |
---|
DataAccessException(java.lang.String message)
Constructor for DataAccessException.
|
DataAccessException(java.lang.String message,
java.lang.Throwable cause)
Constructor for DataAccessException.
|
Modifier and Type | Method and Description |
---|---|
<T extends java.lang.Throwable> |
getCause(java.lang.Class<? extends T> type)
Find a root cause of a given type, or
null if no root cause
of that type was found. |
java.lang.StackTraceElement[] |
getStackTrace() |
java.lang.String |
sqlState()
Retrieve the
SQLException.getSQLState() from Throwable.getCause() ,
if this DataAccessException was caused by a
SQLException . |
SQLStateClass |
sqlStateClass()
Decode the
SQLException.getSQLState() from Throwable.getCause()
into SQLStateClass , if this DataAccessException was
caused by a SQLException . |
SQLStateSubclass |
sqlStateSubclass()
Decode the
SQLException.getSQLState() from Throwable.getCause()
into SQLStateSubclass , if this DataAccessException was
caused by a SQLException . |
public DataAccessException(java.lang.String message)
message
- the detail messagepublic DataAccessException(java.lang.String message, java.lang.Throwable cause)
message
- the detail messagecause
- the root cause (usually from using a underlying data access
API such as JDBC)public java.lang.String sqlState()
SQLException.getSQLState()
from Throwable.getCause()
,
if this DataAccessException
was caused by a
SQLException
.public SQLStateClass sqlStateClass()
SQLException.getSQLState()
from Throwable.getCause()
into SQLStateClass
, if this DataAccessException
was
caused by a SQLException
.public SQLStateSubclass sqlStateSubclass()
SQLException.getSQLState()
from Throwable.getCause()
into SQLStateSubclass
, if this DataAccessException
was
caused by a SQLException
.public java.lang.StackTraceElement[] getStackTrace()
getStackTrace
in class java.lang.Throwable
public <T extends java.lang.Throwable> T getCause(java.lang.Class<? extends T> type)
null
if no root cause
of that type was found.Copyright © 2018. All Rights Reserved.