Package java.sql
Class SQLIntegrityConstraintViolationException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.sql.SQLException
java.sql.SQLNonTransientException
java.sql.SQLIntegrityConstraintViolationException
- All Implemented Interfaces:
Serializable,Iterable<Throwable>
public class SQLIntegrityConstraintViolationException extends SQLNonTransientException
An exception, which is subclass of SQLNonTransientException, is thrown when
various the an integrity constraint (foreign key, primary key or unique key)
has been violated.
- See Also:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description SQLIntegrityConstraintViolationException()Creates an SQLIntegrityConstraintViolationException object.SQLIntegrityConstraintViolationException(String reason)Creates an SQLIntegrityConstraintViolationException object.SQLIntegrityConstraintViolationException(String reason, String sqlState)Creates an SQLIntegrityConstraintViolationException object.SQLIntegrityConstraintViolationException(String reason, String sqlState, int vendorCode)Creates an SQLIntegrityConstraintViolationException object.SQLIntegrityConstraintViolationException(String reason, String sqlState, int vendorCode, Throwable cause)Creates an SQLIntegrityConstraintViolationException object.SQLIntegrityConstraintViolationException(String reason, String sqlState, Throwable cause)Creates an SQLIntegrityConstraintViolationException object.SQLIntegrityConstraintViolationException(String reason, Throwable cause)Creates an SQLIntegrityConstraintViolationException object.SQLIntegrityConstraintViolationException(Throwable cause)Creates an SQLIntegrityConstraintViolationException object. -
Method Summary
Methods inherited from class java.sql.SQLException
getErrorCode, getNextException, getSQLState, iterator, setNextExceptionMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
SQLIntegrityConstraintViolationException
public SQLIntegrityConstraintViolationException()Creates an SQLIntegrityConstraintViolationException object. The Reason string is set to null, the SQLState string is set to null and the Error Code is set to 0. -
SQLIntegrityConstraintViolationException
Creates an SQLIntegrityConstraintViolationException object. The Reason string is set to the given reason string, the SQLState string is set to null and the Error Code is set to 0.- Parameters:
reason- the string to use as the Reason string
-
SQLIntegrityConstraintViolationException
Creates an SQLIntegrityConstraintViolationException object. The Reason string is set to the given reason string, the SQLState string is set to the given SQLState string and the Error Code is set to 0.- Parameters:
reason- the string to use as the Reason stringsqlState- the string to use as the SQLState string
-
SQLIntegrityConstraintViolationException
Creates an SQLIntegrityConstraintViolationException object. The Reason string is set to the given reason string, the SQLState string is set to the given SQLState string and the Error Code is set to the given error code value.- Parameters:
reason- the string to use as the Reason stringsqlState- the string to use as the SQLState stringvendorCode- the integer value for the error code
-
SQLIntegrityConstraintViolationException
Creates an SQLIntegrityConstraintViolationException object. The Reason string is set to the null if cause == null or cause.toString() if cause!=null,and the cause Throwable object is set to the given cause Throwable object.- Parameters:
cause- the Throwable object for the underlying reason this SQLException
-
SQLIntegrityConstraintViolationException
Creates an SQLIntegrityConstraintViolationException object. The Reason string is set to the given and the cause Throwable object is set to the given cause Throwable object.- Parameters:
reason- the string to use as the Reason stringcause- the Throwable object for the underlying reason this SQLException
-
SQLIntegrityConstraintViolationException
Creates an SQLIntegrityConstraintViolationException object. The Reason string is set to the given reason string, the SQLState string is set to the given SQLState string and the cause Throwable object is set to the given cause Throwable object.- Parameters:
reason- the string to use as the Reason stringsqlState- the string to use as the SQLState stringcause- the Throwable object for the underlying reason this SQLException
-
SQLIntegrityConstraintViolationException
public SQLIntegrityConstraintViolationException(String reason, String sqlState, int vendorCode, Throwable cause)Creates an SQLIntegrityConstraintViolationException object. The Reason string is set to the given reason string, the SQLState string is set to the given SQLState string , the Error Code is set to the given error code value, and the cause Throwable object is set to the given cause Throwable object.- Parameters:
reason- the string to use as the Reason stringsqlState- the string to use as the SQLState stringvendorCode- the integer value for the error codecause- the Throwable object for the underlying reason this SQLException
-