Package org.jooq.exception
Class DataAccessException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- org.jooq.exception.DataAccessException
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
ConfigurationException
,DataChangedException
,DataTypeException
,DetachedException
,InvalidResultException
,IOException
,LoaderConfigurationException
,MappingException
,MockFileDatabaseException
,ParserException
public class DataAccessException extends java.lang.RuntimeException
TheDataAccessException
is a genericRuntimeException
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 DataAccessException- Author:
- Sergey Epik - Merged into jOOQ from Spring JDBC Support, Lukas Eder
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DataAccessException(java.lang.String message)
Constructor for DataAccessException.DataAccessException(java.lang.String message, java.lang.Throwable cause)
Constructor for DataAccessException.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T extends java.lang.Throwable>
TgetCause(java.lang.Class<? extends T> type)
Find a root cause of a given type, ornull
if no root cause of that type was found.java.lang.StackTraceElement[]
getStackTrace()
java.lang.String
sqlState()
Retrieve theSQLException.getSQLState()
fromThrowable.getCause()
, if thisDataAccessException
was caused by aSQLException
.SQLStateClass
sqlStateClass()
Decode theSQLException.getSQLState()
fromThrowable.getCause()
intoSQLStateClass
, if thisDataAccessException
was caused by aSQLException
.SQLStateSubclass
sqlStateSubclass()
Decode theSQLException.getSQLState()
fromThrowable.getCause()
intoSQLStateSubclass
, if thisDataAccessException
was caused by aSQLException
.
-
-
-
Constructor Detail
-
DataAccessException
public DataAccessException(java.lang.String message)
Constructor for DataAccessException.- Parameters:
message
- the detail message
-
DataAccessException
public DataAccessException(java.lang.String message, java.lang.Throwable cause)
Constructor for DataAccessException.- Parameters:
message
- the detail messagecause
- the root cause (usually from using a underlying data access API such as JDBC)
-
-
Method Detail
-
sqlState
public java.lang.String sqlState()
Retrieve theSQLException.getSQLState()
fromThrowable.getCause()
, if thisDataAccessException
was caused by aSQLException
.
-
sqlStateClass
public SQLStateClass sqlStateClass()
Decode theSQLException.getSQLState()
fromThrowable.getCause()
intoSQLStateClass
, if thisDataAccessException
was caused by aSQLException
.
-
sqlStateSubclass
public SQLStateSubclass sqlStateSubclass()
Decode theSQLException.getSQLState()
fromThrowable.getCause()
intoSQLStateSubclass
, if thisDataAccessException
was caused by aSQLException
.
-
getStackTrace
public java.lang.StackTraceElement[] getStackTrace()
- Overrides:
getStackTrace
in classjava.lang.Throwable
-
getCause
public <T extends java.lang.Throwable> T getCause(java.lang.Class<? extends T> type)
Find a root cause of a given type, ornull
if no root cause of that type was found.
-
-