添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
Direct Known Subclasses:
ConfigurationException , DataChangedException , DataDefinitionException , DataException , DataMigrationException , DataTypeException , DetachedException , IntegrityConstraintViolationException , InvalidResultException , IOException , LoaderConfigurationException , MappingException , MockFileDatabaseException , ParserException , TemplatingException
public class DataAccessException extends RuntimeException
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 SQLException types 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:
  • DataException when jOOQ detects SQLStateClass.C22_DATA_EXCEPTION .
  • IntegrityConstraintViolationException when jOOQ detects SQLStateClass.C23_INTEGRITY_CONSTRAINT_VIOLATION .
  • DataAccessException otherwise.
  • Author:
    Sergey Epik - Merged into jOOQ from Spring JDBC Support, Lukas Eder
    See Also:
  • Serialized Form
  • getCause ( Class <? extends T> type)
    Find a root cause of a given type, or null if no root cause of that type was found.
    @NotNull String
    Retrieve the SQLException.getSQLState() or R2dbcException.getSqlState() from Throwable.getCause() , if this DataAccessException was caused by a SQLException or R2dbcException .
    Decode the SQLException.getSQLState() or R2dbcException.getSqlState() from Throwable.getCause() into SQLStateClass , if this DataAccessException was caused by a SQLException or R2dbcException .
    static @NotNull SQLStateClass
    sqlStateClass (io.r2dbc.spi.R2dbcException e)
    Decode the R2dbcException.getSqlState() into SQLStateClass .
    static @NotNull SQLStateClass
    Decode the SQLException.getSQLState() or R2dbcException.getSqlState() from Throwable.getCause() into SQLStateSubclass , if this DataAccessException was caused by a SQLException or R2dbcException .

    Methods inherited from class java.lang. Throwable

    addSuppressed , fillInStackTrace , getCause , getLocalizedMessage , getMessage , getSuppressed , initCause , printStackTrace , printStackTrace , printStackTrace , setStackTrace , toString

    Methods inherited from class java.lang. Object

    clone , equals , finalize , getClass , hashCode , notify , notifyAll , wait , wait , wait

    DataAccessException

    public DataAccessException ( String message)
    Constructor for DataAccessException.
    Parameters:
    message - the detail message
    public DataAccessException ( String message, Throwable cause)
    Constructor for DataAccessException.
    Parameters:
    message - the detail message
    cause - the root cause (usually from using a underlying data access API such as JDBC)
    public @NotNull String sqlState ()
    Retrieve the SQLException.getSQLState() or R2dbcException.getSqlState() from Throwable.getCause() , if this DataAccessException was caused by a SQLException or R2dbcException .
    @NotNull public @NotNull SQLStateClass sqlStateClass ()
    Decode the SQLException.getSQLState() or R2dbcException.getSqlState() from Throwable.getCause() into SQLStateClass , if this DataAccessException was caused by a SQLException or R2dbcException .

    sqlStateClass

    @NotNull public static @NotNull SQLStateClass sqlStateClass ( SQLException e)

    sqlStateClass

    @NotNull public static @NotNull SQLStateClass sqlStateClass (io.r2dbc.spi.R2dbcException e)
    Decode the R2dbcException.getSqlState() into SQLStateClass .
    @NotNull public @NotNull SQLStateSubclass sqlStateSubclass ()
    Decode the SQLException.getSQLState() or R2dbcException.getSqlState() from Throwable.getCause() into SQLStateSubclass , if this DataAccessException was caused by a SQLException or R2dbcException .
    @Nullable 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.