SQLGrammarException :could not execute query a.user not exists解决
2012-10-17 11:16
507 查看
今天整合一个ssh的小项目,发现报了这个错误,很明显说的是user表不存在,
后来发现原来是Query query = session.createSQLQuery("select * from User");
这里面的User是类名,应该写成表名A_USER,这是hibernate的本地SQL查询方式
Query query = session.createSQLQuery("select * from A_User");
如果用HQL查询方式时,才能用到类名,也就是from User
后来发现原来是Query query = session.createSQLQuery("select * from User");
这里面的User是类名,应该写成表名A_USER,这是hibernate的本地SQL查询方式
Query query = session.createSQLQuery("select * from A_User");
如果用HQL查询方式时,才能用到类名,也就是from User
相关文章推荐
- org.hibernate.exception.SQLGrammarException: could not execute query
- nested exception is org.hibernate.exception.SQLGrammarException: could not execute query
- org.hibernate.exception.SQLGrammarException: could not execute query
- org.hibernate.exception.SQLGrammarException: could not execute query处理方式
- org.hibernate.exception.SQLGrammarException:Could not execute JDBC batch update问题的解决
- org.hibernate.exception.SQLGrammarException:Could not execute JDBC batch update问题的解决
- org.hibernate.exception.SQLGrammarException: could not execute query
- [已解决]org.hibernate.exception.SQLGrammarException: could not execute statement
- org.hibernate.exception.SQLGrammarException: could not execute query
- 异常积累:org.hibernate.exception.SQLGrammarException: could not execute query-hibernate解释后的sql语句有问题
- org.hibernate.exception.SQLGrammarException:Could not execute JDBC batch update问题的解决
- org.hibernate.exception.SQLGrammarException: could not execute query
- org.hibernate.exception.SQLGrammarException: could not execute query处理方式
- org.hibernate.exception.SQLGrammarException: could not execute query
- SQLGrammarException: could not execute query的原因
- org.hibernate.exception.SQLGrammarException: could not execute query
- org.hibernate.exception.SQLGrammarException: could not execute query
- org.hibernate.exception.SQLGrammarException:Could not execute JDBC batch update问题的解决
- org.hibernate.exception.SQLGrammarException: Could not execute JDBC batch update
- org.hibernate.exception.SQLGrammarException: could not execute statement