当前位置:   article > 正文

Java Web开发遇到 java.sql.SQLIntegrityConstraintViolationException: 解决办法_nested exception is java.sql.sqlintegrityconstrain

nested exception is java.sql.sqlintegrityconstraintviolationexception: dupli

最近在学习javaweb开发update更新接口的过程中遇到了java.sql.SQLIntegrityConstraintViolationException: 

问题如下图 

Cause: java.sql.SQLIntegrityConstraintViolationException: Duplicate entry '开发部' for key 'dept.name'
; Duplicate entry '开发部' for key 'dept.name'; nested exception is java.sql.SQLIntegrityConstraintViolationException: Duplicate entry '开发部' for key 'dept.name'] with root cause

我使用apipost测试接口,报错如下

 后面经过查询后明白了是使用更新sql语句时,传入的更新参数违反了数据库的唯一约束条件。插入数据时,具有唯一约束条件的列值重复了。所以当我把传入的参数修改后再使用apipost就能正常使用了

 以上只为学习过程中的记录


 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/你好赵伟/article/detail/625139
推荐阅读
相关标签
  

闽ICP备14008679号