java.sql.SQLException: General error, message from server: "Field 'ID' doesn't have a default value
2016-01-31 17:09
776 查看
在学习hibernate的时候出现了如下错误:
在网上查了资料,发现是因为我数据库中ID字段是主键但是没有设置AUTO_INCREMENT,所以出现如上错误。从新将设置ID字段的auto_increment属性即可解决问题
在网上查了资料,发现是因为我数据库中ID字段是主键但是没有设置AUTO_INCREMENT,所以出现如上错误。从新将设置ID字段的auto_increment属性即可解决问题
相关文章推荐
- java.sql.SQLException: ORA-28001: the password has expired
- java.sql.SQLException: ORA-01006: 绑定变量不存在
- java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)
- Mysql的ORDER BY 和Limit offset的一个问题,拿出来和大家研究下
- java.sql.SQLException: ORA-00911: invalid character 解决方法(转)
- SQLException: Could not open JDBC Connection for
- 用户代码未处理 SqlException
- java.sql.SQLException: 无效的列类型
- 解决 Unable to translate SQLException with Error code '17059', will now try the fallback translator
- SQLException: Access denied for user 'root'@'localhost' (using password: YES)解决方法
- SQLException: Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp
- SQLException: Invalid parameter object type. Expected 'java.util.ArrayList' but found 'java.util.Ar
- 【JavaEE】SQLException:Generated keys not requested. You need to specify Statement.RETURN_GE
- 【报错】BatchUpdateException: Data truncated for column 'id' at row 1
- java.sql.SQLException: An attempt by a client to checkout a Connection has timed out
- java.sql.SQLException: Access denied FOR USER 'test'@'DESKTOP-KQLR3L8' (USING PASSWORD: YES)
- Hibernate大批量的数据更新缓存问题(Could not synchronize database state with session)
- java.sql.SQLException: Parameter index out of range (1 > number of parameters, which is 0)
- java.sql.SQLException: Already closed.
- Ajax请求数据提示org.apache.struts2.json.JSONException错误