Package org.hibernate

Class JDBCException

    • Constructor Summary

      Constructors 
      Constructor Description
      JDBCException​(java.lang.String message, java.sql.SQLException cause)
      Constructs a JDBCException using the given information.
      JDBCException​(java.lang.String message, java.sql.SQLException cause, java.lang.String sql)
      Constructs a JDBCException using the given information.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getErrorCode()
      Get the vendor specific error code from the underlying SQLException.
      java.lang.String getSQL()
      Get the actual SQL statement being executed when the exception occurred.
      java.sql.SQLException getSQLException()
      Get the underlying SQLException.
      java.lang.String getSQLState()
      Get the X/Open or ANSI SQL SQLState error code from the underlying SQLException.
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, 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

      • JDBCException

        public JDBCException​(java.lang.String message,
                             java.sql.SQLException cause)
        Constructs a JDBCException using the given information.
        Parameters:
        message - The message explaining the exception condition
        cause - The underlying cause
      • JDBCException

        public JDBCException​(java.lang.String message,
                             java.sql.SQLException cause,
                             java.lang.String sql)
        Constructs a JDBCException using the given information.
        Parameters:
        message - The message explaining the exception condition
        cause - The underlying cause
        sql - The sql being executed when the exception occurred
    • Method Detail

      • getSQLState

        public java.lang.String getSQLState()
        Get the X/Open or ANSI SQL SQLState error code from the underlying SQLException.
        Returns:
        The X/Open or ANSI SQL SQLState error code; may return null.
        See Also:
        SQLException.getSQLState()
      • getErrorCode

        public int getErrorCode()
        Get the vendor specific error code from the underlying SQLException.
        Returns:
        The vendor specific error code
        See Also:
        SQLException.getErrorCode()
      • getSQLException

        public java.sql.SQLException getSQLException()
        Get the underlying SQLException.
        Returns:
        The SQLException
      • getSQL

        public java.lang.String getSQL()
        Get the actual SQL statement being executed when the exception occurred.
        Returns:
        The SQL statement; may return null.