java.lang.Object
java.lang.Throwable
java.lang.Exception
java.sql.SQLException
java.sql.SQLNonTransientException
java.sql.SQLIntegrityConstraintViolationException
- 所有已实现的接口:
Serializable,Iterable<Throwable>
当 SQLState 类值为 ' 时抛出
SQLException 的子类23',或在供应商指定的条件下。这表示违反了完整性约束(外键、主键或唯一键)。
请查阅您的驱动程序供应商文档,了解可能引发此 Exception 的供应商指定条件。
- 自从:
- 1.6
- 参见:
-
构造方法总结
构造方法构造方法描述构造一个SQLIntegrityConstraintViolationException对象。用给定的reason构造一个SQLIntegrityConstraintViolationException。SQLIntegrityConstraintViolationException(String reason, String SQLState) 使用给定的reason和SQLState构造一个SQLIntegrityConstraintViolationException对象。SQLIntegrityConstraintViolationException(String reason, String SQLState, int vendorCode) 使用给定的reason、SQLState和vendorCode构造一个SQLIntegrityConstraintViolationException对象。SQLIntegrityConstraintViolationException(String reason, String SQLState, int vendorCode, Throwable cause) 使用给定的reason、SQLState、vendorCode和cause构造一个SQLIntegrityConstraintViolationException对象。SQLIntegrityConstraintViolationException(String reason, String SQLState, Throwable cause) 使用给定的reason、SQLState和cause构造一个SQLIntegrityConstraintViolationException对象。SQLIntegrityConstraintViolationException(String reason, Throwable cause) 使用给定的reason和cause构造一个SQLIntegrityConstraintViolationException对象。使用给定的cause构造一个SQLIntegrityConstraintViolationException对象。 -
方法总结
在类 java.sql.SQL异常 中声明的方法
getErrorCode, getNextException, getSQLState, iterator, setNextException在类 java.lang.Throwable 中声明的方法
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString在类 java.lang.Object 中声明的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait在接口 java.lang.Iterable 中声明的方法
forEach, spliterator
-
构造方法详细信息
-
SQLIntegrityConstraintViolationException
public SQLIntegrityConstraintViolationException()构造一个SQLIntegrityConstraintViolationException对象。reason、SQLState初始化为null,供应商代码初始化为 0。cause未初始化,随后可通过调用Throwable.initCause(java.lang.Throwable)方法进行初始化。- 自从:
- 1.6
-
SQLIntegrityConstraintViolationException
用给定的reason构造一个SQLIntegrityConstraintViolationException。SQLState初始化为null,供应商代码初始化为 0。cause未初始化,随后可通过调用Throwable.initCause(java.lang.Throwable)方法进行初始化。- 参数:
reason- 异常的描述- 自从:
- 1.6
-
SQLIntegrityConstraintViolationException
使用给定的reason和SQLState构造一个SQLIntegrityConstraintViolationException对象。cause未初始化,随后可能会通过调用Throwable.initCause(java.lang.Throwable)方法进行初始化。供应商代码初始化为 0。- 参数:
reason- 异常的描述SQLState- 标识异常的 XOPEN 或 SQL:2003 代码- 自从:
- 1.6
-
SQLIntegrityConstraintViolationException
使用给定的reason、SQLState和vendorCode构造一个SQLIntegrityConstraintViolationException对象。cause未初始化,随后可能会通过调用Throwable.initCause(java.lang.Throwable)方法进行初始化。- 参数:
reason- 异常的描述SQLState- 标识异常的 XOPEN 或 SQL:2003 代码vendorCode- 数据库供应商特定的异常代码- 自从:
- 1.6
-
SQLIntegrityConstraintViolationException
使用给定的cause构造一个SQLIntegrityConstraintViolationException对象。SQLState初始化为null,供应商代码初始化为 0。reason初始化为null(如果是cause==null)或cause.toString()(如果是cause!=null)。- 参数:
cause- 此SQLException的根本原因(保存以供以后通过getCause()方法检索);可能为空,表示原因不存在或未知。- 自从:
- 1.6
-
SQLIntegrityConstraintViolationException
使用给定的reason和cause构造一个SQLIntegrityConstraintViolationException对象。SQLState初始化为null,供应商代码初始化为 0。- 参数:
reason- 异常的描述。cause- (保存以供以后通过getCause()方法检索);可能为空,表示原因不存在或未知。- 自从:
- 1.6
-
SQLIntegrityConstraintViolationException
使用给定的reason、SQLState和cause构造一个SQLIntegrityConstraintViolationException对象。供应商代码初始化为 0。- 参数:
reason- 异常的描述。SQLState- 标识异常的 XOPEN 或 SQL:2003 代码cause- 此SQLException的根本原因(保存以供以后通过getCause()方法检索);可能为空,表示原因不存在或未知。- 自从:
- 1.6
-
SQLIntegrityConstraintViolationException
public SQLIntegrityConstraintViolationException(String reason, String SQLState, int vendorCode, Throwable cause) 使用给定的reason、SQLState、vendorCode和cause构造一个SQLIntegrityConstraintViolationException对象。- 参数:
reason- 异常的描述SQLState- 标识异常的 XOPEN 或 SQL:2003 代码vendorCode- 特定于数据库供应商的异常代码cause- (保存以供以后通过getCause()方法检索);可能为空,表示原因不存在或未知。- 自从:
- 1.6
-