Class DataAccessException

    • 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>
      T
      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.
      • 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
    • 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 message
        cause - the root cause (usually from using a underlying data access API such as JDBC)
    • Method Detail

      • sqlState

        public java.lang.String sqlState()
        Retrieve the SQLException.getSQLState() from Throwable.getCause(), if this DataAccessException was caused by a SQLException.
      • sqlStateClass

        public SQLStateClass sqlStateClass()
        Decode the SQLException.getSQLState() from Throwable.getCause() into SQLStateClass, if this DataAccessException was caused by a SQLException.
      • sqlStateSubclass

        public SQLStateSubclass sqlStateSubclass()
        Decode the SQLException.getSQLState() from Throwable.getCause() into SQLStateSubclass, if this DataAccessException was caused by a SQLException.
      • getStackTrace

        public java.lang.StackTraceElement[] getStackTrace()
        Overrides:
        getStackTrace in class java.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, or null if no root cause of that type was found.