Android APIs
public class

SQLIntegrityConstraintViolationException

extends SQLNonTransientException
java.lang.Object
   ↳ java.lang.Throwable
     ↳ java.lang.Exception
       ↳ java.sql.SQLException
         ↳ java.sql.SQLNonTransientException
           ↳ java.sql.SQLIntegrityConstraintViolationException

Class Overview

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.

Summary

Public Constructors
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(Throwable cause)
Creates an SQLIntegrityConstraintViolationException object.
SQLIntegrityConstraintViolationException(String reason, Throwable cause)
Creates an SQLIntegrityConstraintViolationException object.
SQLIntegrityConstraintViolationException(String reason, String sqlState, Throwable cause)
Creates an SQLIntegrityConstraintViolationException object.
SQLIntegrityConstraintViolationException(String reason, String sqlState, int vendorCode, Throwable cause)
Creates an SQLIntegrityConstraintViolationException object.
[Expand]
Inherited Methods
From class java.sql.SQLException
From class java.lang.Throwable
From class java.lang.Object
From interface java.lang.Iterable

Public Constructors

public SQLIntegrityConstraintViolationException ()

Added in API level 9

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.

public SQLIntegrityConstraintViolationException (String reason)

Added in API level 9

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 String: the string to use as the Reason string

public SQLIntegrityConstraintViolationException (String reason, String sqlState)

Added in API level 9

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 String: the string to use as the Reason string
sqlState String: the string to use as the SQLState string

public SQLIntegrityConstraintViolationException (String reason, String sqlState, int vendorCode)

Added in API level 9

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 String: the string to use as the Reason string
sqlState String: the string to use as the SQLState string
vendorCode int: the integer value for the error code

public SQLIntegrityConstraintViolationException (Throwable cause)

Added in API level 9

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 Throwable: the Throwable object for the underlying reason this SQLException

public SQLIntegrityConstraintViolationException (String reason, Throwable cause)

Added in API level 9

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 String: the string to use as the Reason string
cause Throwable: the Throwable object for the underlying reason this SQLException

public SQLIntegrityConstraintViolationException (String reason, String sqlState, Throwable cause)

Added in API level 9

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 String: the string to use as the Reason string
sqlState String: the string to use as the SQLState string
cause Throwable: the Throwable object for the underlying reason this SQLException

public SQLIntegrityConstraintViolationException (String reason, String sqlState, int vendorCode, Throwable cause)

Added in API level 9

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 String: the string to use as the Reason string
sqlState String: the string to use as the SQLState string
vendorCode int: the integer value for the error code
cause Throwable: the Throwable object for the underlying reason this SQLException