org.hibernate.exception.SQLGrammarException: could not extract ResultSet
2017-06-07 14:55
489 查看
org.hibernate.exception.SQLGrammarException: could not extract ResultSet 的恶心问题,其实这个问题的错误根本原因就是表中的结构和字段跟java中实体类的不对应,所以就报这个错误了,也许你在网上去查找的时候,都是直接说不对应,造成的,而你也一直去看,对应的呀,哈哈,可能就是那个结构有问题吧,其实我也不太懂,在主配置文件里面加上
<property name="hibernate.hbm2ddl.auto">update</property> 就解决问题了,其实正常流程,不会出错的!
四个参数,这边列出来,看下:validate 加载hibernate时,验证创建数据库表结构
create 每次加载hibernate,重新创建数据库表结构,这就是导致数据库表数据丢失的原因。
create-drop 加载hibernate时创建,退出是删除表结构
update 加载hibernate自动更新数据库结构
以上4个属性对同一配置文件下所用有的映射表都起作用
相关文章推荐
- org.hibernate.exception.SQLGrammarException: could not extract ResultSet
- org.hibernate.exception.SQLGrammarException: could not extract ResultSet
- 报错org.springframework.dao.InvalidDataAccessResourceUsageException: could not extract ResultSet; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet"
- Caused by: org.hibernate.exception.SQLGrammarException: could not extract ResultSet 报错原因
- org.hibernate.exception.SQLGrammarException: could not extract ResultSet at org.hibernate.exception.
- org.hibernate.exception.SQLGrammarException: could not extract ResultSet
- 错误:org.hibernate.exception.SQLGrammarException: could not execute
- org.hibernate.exception.SQLGrammarException: could not insert……
- org.hibernate.exception.SQLGrammarException: could notinsert: [com.michael.model.Storen]
- org.hibernate.exception.SQLGrammarException: could not execute query
- Exception in thread "main" org.hibernate.exception.SQLGrammarException: could not fetch initial valu
- org.hibernate.exception.SQLGrammarException:Could not execute JDBC batch update问题的解决
- org.hibernate.exception.SQLGrammarException: could not execute query
- Hibernate: org.hibernate.exception.SQLGrammarException: could not insert: 错误
- nested exception is org.hibernate.exception.SQLGrammarException: could not get next sequence value
- “org.hibernate.exception.SQLGrammarException: could not insert...”解决方法
- org.hibernate.exception.SQLGrammarException: Could not execute JDBC batch update
- org.hibernate.exception.SQLGrammarException: could not insert
- org.hibernate.exception.SQLGrammarException: Could not execute JDBC batch update
- org.hibernate.exception.SQLGrammarException: could not execute query