org.springframework.dao.DataIntegrityViolationException

文章最前: 我是Octopus,这个名字来源于我的中文名--章鱼;我热爱编程、热爱算法、热爱开源。所有源码在我的个人github ;这博客是记录我学习的点点滴滴,如果您对 Python、Java、AI、算法有兴趣,可以关注我的动态,一起学习,共同进步。

相关文章:

  1. DuplicateKeyException异常处理:java向数据库插入数据异
  2. springboot的UnsatisfiedDependencyException异常问题
  3. org.springframework.dao.DataIntegrityViolationException
  4. com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'current_state'
  5. java中出现这种错误: "error": "Internal Server Error",
  6. The Tomcat connector configured to listen on port 8888 failed to start
  7. java.nio.charset.MalformedInputException错误解决
  8. org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.geekplus.dao

文章目录

1.问题描述:

2.问题解决:


1.问题描述:

org.springframework.dao.DataIntegrityViolationException: 
### Error updating database.  Cause: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'id' at row 1
### The error may exist in file [D:\software\Spring-Boot-EHCache-master\ehcache-provider\target\classes\mapper\UserMapper.xml]
### The error may involve com.huntkey.rx.ehcache.provider.dao.UserDao.insert-Inline
### The error occurred while setting parameters
### SQL: insert into tbl_user         (id,userid,username,`name`,age,balance)         values(         ?,         ?,         ?,         ?,         ?,         ?         )
### Cause: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'id' at row 1
; SQL []; Data truncation: Data too long for column 'id' at row 1; nested exception is com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'id' at row 1

2.问题解决:


出现这种错误,就是数据库中的字段太短,插入到数据库中的字段太大了,就会出现: Data too long for column 'id' at row 1

  • 3
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值