java.sql.SQLIntegrityConstraintViolationException: Column 'USER_NAME' cannot be null
时间: 2024-04-28 21:22:41 浏览: 209
Caused by: java.sql.SQLIntegrityConstraintViolationException: Cannot delete or update a parent row:
这个错误通常表示在执行数据库操作时,某个列的值为NULL,但该列被指定为不允许为NULL的列。根据您提供的引用内容,问题可能出现在参数名字写错导致后端程序接收不到字段值。您可以尝试修改参数名字以确保与实体类对应的参数名字一致。这样,后端程序将能够正确接收到参数并不再显示字段值为空。另外,还有一些其他可能导致类似错误的原因,比如不满足主键约束等,请确保您的表结构和约束设置正确。根据中提到的情况,如果在父表中删除记录时,存在对应的外键关系,则可以设置子表中该外键值为NULL,以满足外键约束。此外,根据中的情况,控制层没有正确获取到客户端提交的数据也可能导致这个错误。您可以检查您的控制层代码,确保正确获取并处理了提交的数据。如果您有具体的错误堆栈信息,可以提供更多细节,以便进一步分析和解决问题。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [报错 Cause: java.sql.SQLIntegrityConstraintViolationException: Column ‘xxxxxxxx‘ cannot be null](https://blog.csdn.net/weixin_45606985/article/details/129116193)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [Caused by: java.sql.SQLIntegrityConstraintViolationException: Cannot delete or update a parent row:](https://download.csdn.net/download/weixin_38500572/13684759)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [Cause: java.sql.SQLIntegrityConstraintViolationException: Column ‘name‘ cannot be null](https://blog.csdn.net/m0_54163080/article/details/114635416)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文