Class ConstraintViolationException

  • All Implemented Interfaces:
    java.io.Serializable

    public class ConstraintViolationException
    extends JDBCException
    Implementation of JDBCException indicating that the requested DML operation resulted in a violation of a defined integrity constraint.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      ConstraintViolationException​(java.lang.String message, java.sql.SQLException root, java.lang.String constraintName)  
      ConstraintViolationException​(java.lang.String message, java.sql.SQLException root, java.lang.String sql, java.lang.String constraintName)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getConstraintName()
      Returns the name of the violated constraint, if known.
      • 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

      • ConstraintViolationException

        public ConstraintViolationException​(java.lang.String message,
                                            java.sql.SQLException root,
                                            java.lang.String constraintName)
      • ConstraintViolationException

        public ConstraintViolationException​(java.lang.String message,
                                            java.sql.SQLException root,
                                            java.lang.String sql,
                                            java.lang.String constraintName)
    • Method Detail

      • getConstraintName

        public java.lang.String getConstraintName()
        Returns the name of the violated constraint, if known.
        Returns:
        The name of the violated constraint, or null if not known.