Top Description Constructors Methods
org.jooq.exception

public Class DataAccessException

extends RuntimeException
Class Inheritance
Known Direct Subclasses
org.jooq.exception.DataChangedException, org.jooq.exception.DataDefinitionException, org.jooq.exception.DataException, org.jooq.exception.DataMigrationException, org.jooq.exception.DataTypeException, org.jooq.exception.DetachedException, org.jooq.exception.IntegrityConstraintViolationException, org.jooq.exception.InvalidResultException, org.jooq.exception.IOException, org.jooq.exception.LoaderConfigurationException, org.jooq.exception.MappingException, org.jooq.exception.MockFileDatabaseException, org.jooq.exception.TemplatingException, org.jooq.impl.ParserException, org.jooq.exception.ConfigurationException
Static Imports
org.jooq.tools.StringUtils.defaultIfNull

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

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:

Authors
Sergey Epik - Merged into jOOQ from Spring JDBC Support, Lukas Eder

Constructor Summary

AccessConstructor and Description
public
DataAccessException(String
the detail message
message
)

Constructor for DataAccessException.

public
DataAccessException(String
the detail message
message
,
Throwable
the root cause (usually from using a underlying data access API such as JDBC)
cause
)

Constructor for DataAccessException.

Method Summary

Modifier and TypeMethod and Description
public <T extends Throwable> T
getCause(Class<? extends T> type)

Find a root cause of a given type, or null if no root cause of that type was found.

public StackTraceElement[]
getStackTrace()

Overrides java.lang.Throwable.getStackTrace.

Provides programmatic access to the stack trace information printed by printStackTrace().
public @NotNull String
sqlState()

Retrieve the SQLException#getSQLState() or R2dbcException#getSqlState() from getCause(), if this DataAccessException was caused by a SQLException or R2dbcException.

public @NotNull SQLStateClass
sqlStateClass()

Decode the SQLException#getSQLState() or R2dbcException#getSqlState() from getCause() into SQLStateClass, if this DataAccessException was caused by a SQLException or R2dbcException.

public static @NotNull SQLStateClass
public static @NotNull SQLStateClass
public @NotNull SQLStateSubclass

Constructor Detail

DataAccessExceptionback to summary
public DataAccessException(String message)

Constructor for DataAccessException.

Parameters
message:String

the detail message

DataAccessExceptionback to summary
public DataAccessException(String message, Throwable cause)

Constructor for DataAccessException.

Parameters
message:String

the detail message

cause:Throwable

the root cause (usually from using a underlying data access API such as JDBC)

Method Detail

getCauseback to summary
public <T extends Throwable> T getCause(Class<? extends T> type)

Find a root cause of a given type, or null if no root cause of that type was found.

Annotations
@Nullable
getStackTraceback to summary
public StackTraceElement[] getStackTrace()

Overrides java.lang.Throwable.getStackTrace.

Doc from java.lang.Throwable.getStackTrace.

Provides programmatic access to the stack trace information printed by printStackTrace(). Returns an array of stack trace elements, each representing one stack frame. The zeroth element of the array (assuming the array's length is non-zero) represents the top of the stack, which is the last method invocation in the sequence. Typically, this is the point at which this throwable was created and thrown. The last element of the array (assuming the array's length is non-zero) represents the bottom of the stack, which is the first method invocation in the sequence.

Some virtual machines may, under some circumstances, omit one or more stack frames from the stack trace. In the extreme case, a virtual machine that has no stack trace information concerning this throwable is permitted to return a zero-length array from this method. Generally speaking, the array returned by this method will contain one element for every frame that would be printed by printStackTrace. Writes to the returned array do not affect future calls to this method.

Returns:StackTraceElement[]

an array of stack trace elements representing the stack trace pertaining to this throwable.

Annotations
@Override
sqlStateback to summary
public @NotNull String sqlState()

Retrieve the SQLException#getSQLState() or R2dbcException#getSqlState() from getCause(), if this DataAccessException was caused by a SQLException or R2dbcException.

Annotations
@NotNull
sqlStateClassback to summary
public @NotNull SQLStateClass sqlStateClass()

Decode the SQLException#getSQLState() or R2dbcException#getSqlState() from getCause() into SQLStateClass, if this DataAccessException was caused by a SQLException or R2dbcException.

Annotations
@NotNull
sqlStateClassback to summary
public static @NotNull SQLStateClass sqlStateClass(SQLException e)

Decode the SQLException#getSQLState() into SQLStateClass.

Annotations
@NotNull
sqlStateClassback to summary
public static @NotNull SQLStateClass sqlStateClass(R2dbcException e)

Decode the R2dbcException#getSqlState() into SQLStateClass.

Annotations
@NotNull
sqlStateSubclassback to summary
public @NotNull SQLStateSubclass sqlStateSubclass()

Decode the SQLException#getSQLState() or R2dbcException#getSqlState() from getCause() into SQLStateSubclass, if this DataAccessException was caused by a SQLException or R2dbcException.

Annotations
@NotNull