`
ylinn
  • 浏览: 61500 次
  • 性别: Icon_minigender_1
  • 来自: 西安
社区版块
存档分类
最新评论

hibernate出现异常org.hibernate.exception.SQLGrammarException:could not execute

阅读更多

今天给人调试hibernate,发现一个错误,耽误了老半天;

错误提示:org.hibernate.exception.SQLGrammarException: could not execute query
  org.hibernate.exception.ErrorCodeConverter.convert(ErrorCodeConverter.java:70)
  org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
  org.hibernate.loader.Loader.doList(Loader.java:1596)
  org.hibernate.loader.Loader.list(Loader.java:1577)
  org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:395)
  org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:271)
  org.hibernate.impl.SessionImpl.list(SessionImpl.java:844)
  org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)
  org.apache.jsp.index_jsp._jspService(org.apache.jsp.index_jsp:73)
  org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:99)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
  org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:325)
  org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
  org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

 

最后的解决办法是:因为开始采用了hibernate工具生成的*.hbm.xml和pojo文件,移动项目到了另外的机子上,就出现了这样的问题,只要把hbm.xml文件中catalog="*****"删掉就好了

分享到:
评论
4 楼 MacTavish 2012-08-27  
  hbm.xml中没有catalog和schema,也报这样的异常,是神马问题???
3 楼 littlefu 2012-03-29  
不胜感激           
2 楼 ylinn 2011-09-17  
谢谢1楼的补充
1 楼 nldjyhl 2011-08-30  
还有一个原因也会报这错误  schema= "*"

相关推荐

    关键字user附近有语法错误解决方案

    警告: SQL Error: 156, ...org.hibernate.exception.SQLGrammarException: could not execute query org.hibernate.util.JDBCExceptionReporter logExceptions 严重: 关键字 'user' 附近有语法错误。 的解决方案。

    MyEclipse注册机

    Exception in thread "main" org.hibernate.exception.SQLGrammarException: Could not execute JDBC batch update 或者org.springframework.jdbc.BadSqlGrammarException: Hibernate operation: could not insert: ...

    SSH整合项目中容易出现的错误

    nested exception is org.hibernate.exception.SQLGrammarException: could not execute query 这个错误是由于SQL语句有错误,导致查询失败。解决方法是检查SQL语句的正确性,确保语句正确无误。 4. 严重: Error ...

    SSH整合常见错误总结

    **问题描述**:执行Hibernate操作时,如插入数据,遇到`org.hibernate.exception.SQLGrammarException: Could not execute JDBC batch update`异常。 **原因分析**:这通常是由于数据库表不存在或表结构不匹配引起...

    ssh框架报错分析集合

    nested exception is org.hibernate.exception.SQLGrammarException: could not execute query` 这个异常表明执行SQL查询时出现了语法错误。检查并修正相关的SQL语句,确保其符合SQL语法规范,并且与数据库表结构...

    MyEclipse报错说明

    3. **Exception in thread "main" org.hibernate.exception.SQLGrammarException: Could not execute JDBC batch update** Hibernate在执行数据库批处理更新时出现SQL语法错误,可能是由于数据库表不存在或结构不符...

    hibernate 排错 宝典1

    ### 错误四:`org.hibernate.exception.SQLGrammarException: Could not execute JDBC batch update` **错误现象**: 在执行数据库批量操作时,Hibernate抛出`SQLGrammarException`,表明SQL语法错误或数据库不支持...

    框架集合错误解决方案

    nested exception is org.hibernate.exception.SQLGrammarException: could not execute query ``` **问题描述:** 这通常是因为Hibernate执行SQL查询时遇到了语法错误或者数据表结构不匹配等问题。 **解决方法:...

    SSH项目原本使用的sqlserver2005数据库现在改用MySql配置问题修改

    在这个场景中,异常的根因是嵌套的“org.hibernate.exception.SQLGrammarException: could not execute query”,这是Hibernate在处理SQL语句时抛出的异常,通常与SQL语法错误或表结构不匹配有关。当从SQL Server...

    精心整理的ssh2 一些错误问题的记录(推荐)

    ### 错误二:org.hibernate.exception.SQLGrammarException: could not get next sequence value 此错误与Hibernate框架相关,当尝试获取数据库中的下一个序列值时出现语法错误。这通常是因为配置不当或数据库查询...

Global site tag (gtag.js) - Google Analytics