首页 > 代码库 > Hibernate插入错误:GenericJDBCException: could not insert:
Hibernate插入错误:GenericJDBCException: could not insert:
数据库中一般不能建立user(表名为User)表,将User类改名,又一次建立映射,问题就能够解决
当然,还有还有一种情况。就是类中id类型错误。要设置为Integer型才干够设置自己主动增长,否则也会出现插入错误。
数据类型不对也会出现错误。比如:
hibernate自己主动见表会採用数据库的默认编码,假设默认编码不支持中文的话,当插入数据时仍然会报出异常。
hibernate自己主动见表參考:
http://blog.csdn.net/jialinqiang/article/details/8665212
In a word,,数据库中表的结构和类不正确应。
參考:
http://blog.csdn.net/woshishui6501/article/details/7563070#reply
http://bbs.csdn.net/topics/240046731
http://blog.chinaunix.net/uid-20556037-id-2810929.html
Hibernate插入错误:GenericJDBCException: could not insert:
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。