在新增的时候报了这个异常
java.sql.SQLException: Field ‘id’ doesn’t have a default value
其实这个很简单 就是 你的Mysql数据库没有设置自动递增:刚才那就话不就是字段“id”没有默认值
在数据库加上自动递增 别忘了主键也加上 就解决了
相关文章
- ERROR: Field 'PostId' doesn't have a default value Exception in thread "main" org.hibernate.exception.GenericJDBCException: could not execute statement
- mybatis向mysql数据库中插入数据报错Field 'id' doesn't have a default value
- Field 'id' doesn't have a default value问题解决方法
- Field 'id' doesn't have a default value
- java.sql.SQLException: Field 'name' doesn't have a default value
- Field 'id' doesn't have a default value
- Field 'id' doesn't have a default value错误解决方法
- MySQL之Field‘***’doesn’t have a default value错误解决办法
- Field 'id' doesn't have a default value
- hibernate:Field 'id' doesn't have a default value 原因