java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.jooq.exception.DataAccessException
- All Implemented Interfaces:
- Serializable
- Direct Known Subclasses:
- ConfigurationException,- DataChangedException,- DataDefinitionException,- DataException,- DataMigrationException,- DataTypeException,- DetachedException,- IntegrityConstraintViolationException,- InvalidResultException,- IOException,- LoaderConfigurationException,- MappingException,- MockFileDatabaseException,- ParserException,- TemplatingException
The 
DataAccessException is a generic RuntimeException
 indicating that something went wrong while executing a SQL statement from
 jOOQ.
 
 Unlike JDBC, jOOQ throws RuntimeException, knowing that
 
- most SQLExceptiontypes are not recoverable.
- even when they are (e.g.
 SQLIntegrityConstraintViolationException), they won't appear with most statements.
 Apart from jOOQ's own DataAccessException subtypes, which are thrown
 by jOOQ's internals, most SQLException types (or
 R2dbcException types) are translated and wrapped by:
 
- DataExceptionwhen jOOQ detects- SQLStateClass.C22_DATA_EXCEPTION.
- IntegrityConstraintViolationExceptionwhen jOOQ detects- SQLStateClass.C23_INTEGRITY_CONSTRAINT_VIOLATION.
- DataAccessExceptionotherwise.
- Author:
- Sergey Epik - Merged into jOOQ from Spring JDBC Support, Lukas Eder
- See Also:
- 
Constructor SummaryConstructorsConstructorDescriptionDataAccessException(String message) Constructor for DataAccessException.DataAccessException(String message, Throwable cause) Constructor for DataAccessException.
- 
Method SummaryModifier and TypeMethodDescription<T extends Throwable>
 TFind a root cause of a given type, ornullif no root cause of that type was found.@NotNull StringsqlState()Retrieve theSQLException.getSQLState()orR2dbcException.getSqlState()fromThrowable.getCause(), if thisDataAccessExceptionwas caused by aSQLExceptionorR2dbcException.@NotNull SQLStateClassDecode theSQLException.getSQLState()orR2dbcException.getSqlState()fromThrowable.getCause()intoSQLStateClass, if thisDataAccessExceptionwas caused by aSQLExceptionorR2dbcException.static @NotNull SQLStateClasssqlStateClass(io.r2dbc.spi.R2dbcException e) Decode theR2dbcException.getSqlState()intoSQLStateClass.static @NotNull SQLStateClassDecode theSQLException.getSQLState()intoSQLStateClass.Set theSQLStateClass.@NotNull SQLStateSubclassDecode theSQLException.getSQLState()orR2dbcException.getSqlState()fromThrowable.getCause()intoSQLStateSubclass, if thisDataAccessExceptionwas caused by aSQLExceptionorR2dbcException.Set theSQLStateSubclass.Methods inherited from class java.lang.ThrowableaddSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
- 
Constructor Details- 
DataAccessExceptionConstructor for DataAccessException.- Parameters:
- message- the detail message
 
- 
DataAccessExceptionConstructor for DataAccessException.- Parameters:
- message- the detail message
- cause- the root cause (usually from using a underlying data access API such as JDBC)
 
 
- 
- 
Method Details- 
sqlStateRetrieve theSQLException.getSQLState()orR2dbcException.getSqlState()fromThrowable.getCause(), if thisDataAccessExceptionwas caused by aSQLExceptionorR2dbcException.
- 
sqlStateClassDecode theSQLException.getSQLState()orR2dbcException.getSqlState()fromThrowable.getCause()intoSQLStateClass, if thisDataAccessExceptionwas caused by aSQLExceptionorR2dbcException.
- 
sqlStateClassSet theSQLStateClass.
- 
sqlStateClassDecode theSQLException.getSQLState()intoSQLStateClass.
- 
sqlStateClassDecode theR2dbcException.getSqlState()intoSQLStateClass.
- 
sqlStateSubclassSet theSQLStateSubclass.
- 
sqlStateSubclassDecode theSQLException.getSQLState()orR2dbcException.getSqlState()fromThrowable.getCause()intoSQLStateSubclass, if thisDataAccessExceptionwas caused by aSQLExceptionorR2dbcException.
- 
getStackTrace- Overrides:
- getStackTracein class- Throwable
 
- 
getCauseFind a root cause of a given type, ornullif no root cause of that type was found.
 
-