com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException 异常
MySQL完整性约束破坏异常:com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException
在单向多对一关联关系中,如果A 持有 B 的引用(即A是多端,B是一端),也就是A 的外键列指向了B 的主键。那么此时如果先删除B, 再删除A(即先删除一端,再删除A端)。那么就会抛出上述异常。
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Cannot delete or update a parent row: a foreign key constraint fails (`hibernate_3`.`orderform`, CONSTRAINT `FK_kfvdjqhg4jcbn6vggmgbf2s5h` FOREIGN KEY (`CUSTOMER_ID`) REFERENCES `customer` (`ID`))
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance
com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException 异常的更多相关文章
- Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry 'qingmu' for key 'PRIMARY'
### Error updating database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolatio ...
- com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '88888888' for key 'PRIMARY'
严重: Servlet.service() for servlet jsp threw exceptioncom.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityC ...
- com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry 'admin' for key 'UK_dgxl7aijrr4hq8314exhw407s'
严重: Servlet.service() for servlet [spring-mvc] in context with path [/learn] threw exception [Reques ...
- Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Column 'org_mer_id' in where clause is ambiguous
### Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolatio ...
- error:com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException
问题:同样的代码,只能插入一组值,第二组值插入不了 解决:开始我将app_id作为主键,但很明显,同一个app_id会有不同的index,而同一个index也可能对应不同的app_id,因此只能添加一 ...
- 异常解决:Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
异常描述 这个异常通常有如下信息: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failu ...
- com.mysql.jdbc.exceptions.jdbc4.CommunicationsException/com.atomikos.datasource.ResourceException异常解决
tomcat+mysql部署,每天早晨第一次访问web项目,出现mysql的连接timeout异常:com.mysql.jdbc.exceptions.jdbc4.CommunicationsExce ...
- 在hive执行创建表的命令,遇到异常com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Specified key was too long; max key length is 767 bytes
今天在练习hive的操作时,在创建数据表时,遇到了异常 FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.ex ...
- 【异常】ERROR main:com.cloudera.enterprise.dbutil.SqlFileRunner: Exception while executing ddl scripts. com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'ROLES' already exists
1 详细异常 2019-10-11 10:33:55,865 INFO main:com.cloudera.server.cmf.Main: ============================= ...
随机推荐
- js简介 基本操作 以及循环语句 内置对象 函数044
js 全称 javascript 从交互的角度 描述行为 一 .js注释方法: //单行注释 声明变量 var 二 .声明多个变量 : var a = '2' ,b = 4, c = tru ...
- 2.3 if switch for等流程控制
if条件中可以写多个语句,语句的作用域仅限于if,不可在if之外的地方使用 package main import ( "fmt" "io/ioutil" ) ...
- Google Authenticator(谷歌身份验证器)
<!DOCTYPE html>Google Authenticator(谷歌身份验证器) ] Google Authenticator(谷歌身份验证器) Google Authentica ...
- DataGuard具体搭建环节
在上一篇blog中,详细介绍DataGuard实现的原理,本篇介绍DataGuard的具体搭建过程. 主库打开日志,并强制force logging SQL>shutdown immediate ...
- scala 中格式化字符常用的格式符
val name="Fred" val age=20 val weight=150.00 val dd="%s's age is %d,weighs %.2f" ...
- (转)IPC相关的命令
IPC相关的命令 原文:http://www.cnblogs.com/jjzd/p/6773090.html 进程间通信概述 进程间通信有如下的目的: 1.数据传输,一个进程需要将它的数据发送给另一个 ...
- 阻止事件的默认行为,例如click <a>后的跳转~
在W3C中,使用preventDefault()方法: 在IE中,使用window.event.returnValue = false.
- BNU27935——我爱背单词——————【数组模拟】
我爱背单词 Time Limit: 1000ms Memory Limit: 65536KB 64-bit integer IO format: %lld Java class name: ...
- Android界面编程--使用活动条(ActionBar)--通过ActionBar菜单改变TextView的字体和颜色
android:orientation="vertical"(AndroidStudio不提示,这个要记住了) 昨天好不容易把ActionBar从溢出菜单overflow中弄出来了 ...
- MyBatis 中 sqlmapconfig核心标签typeAliases配置说明
标签说明 在 MyBatis 的 sql 映射配置文件中,需要使用 paramterType.resultType 来设置 sql 语句的输入输出参数,一般参数都是基本的数据类型或封装类型,但都需要声 ...