Package org.hibernate

Class JDBCException

    • Constructor Detail

      • JDBCException

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

        public JDBCException​(String message,
                             SQLException cause,
                             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 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()
      • getSQL

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

        public String getErrorMessage()
        Returns:
        The error message without the SQL statement appended