- 浏览: 75944 次
- 性别:
- 来自: 广州
最新评论
-
nali1022:
非常好。我的也出现这个问题
我原来写的是schema=&quo ...
SQLGrammarException -
mrkai:
学习
Java定时重复执行程序
不仔细,一个小小的异常,害我调试了几个小时,实在不应该!
异常信息如下:
Hibernate: insert into CDS_CREDITCAREJG_HIS (ID, BBRQ, BZ, ORG, ITEMS, TZHJ, WJZC, WJGZ, WJCJ, WJKY, WJSS, DBDZY, DBBZ, DBXY, DBBZJ, PD, DW, DRRQ, CHECKFLAG) values (default, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
16:38:46,125 WARN JDBCExceptionReporter:77 - SQL Error: -204, SQLState: 42704
16:38:46,125 ERROR JDBCExceptionReporter:78 - DB2 SQL error: SQLCODE: -204, SQLSTATE: 42704, SQLERRMC: DB2ADMIN.CDS_CREDITCAREJG_HIS
16:38:46,156 WARN JDBCExceptionReporter:77 - SQL Error: -727, SQLState: 56098
16:38:46,156 ERROR JDBCExceptionReporter:78 - DB2 SQL error: SQLCODE: -727, SQLSTATE: 56098, SQLERRMC: 2;-204;42704;DB2ADMIN.CDS_CREDITCAREJG_HIS
16:38:46,156 WARN JDBCExceptionReporter:77 - SQL Error: -727, SQLState: 56098
16:38:46,171 ERROR JDBCExceptionReporter:78 - DB2 SQL error: SQLCODE: -727, SQLSTATE: 56098, SQLERRMC: 2;-204;42704;DB2ADMIN.CDS_CREDITCAREJG_HIS
16:39:08,671 ERROR CreditCareJGHisDAO:50 - save failed
org.springframework.dao.InvalidDataAccessResourceUsageException: could not insert: [com.fenet.gddb.cds.model.datareenter.CreditCareJGHis]; nested exception is org.hibernate.exception.SQLGrammarException: could not insert: [com.fenet.gddb.cds.model.datareenter.CreditCareJGHis]
Caused by:
org.hibernate.exception.SQLGrammarException: could not insert: [com.fenet.gddb.cds.model.datareenter.CreditCareJGHis]
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:40)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2158)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2638)
at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:48)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:250)
at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:298)
at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:181)
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:107)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:187)
at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:33)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:172)
at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:27)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:535)
at org.hibernate.impl.SessionImpl.save(SessionImpl.java:523)
at org.hibernate.impl.SessionImpl.save(SessionImpl.java:519)
at org.springframework.orm.hibernate3.HibernateTemplate$12.doInHibernate(HibernateTemplate.java:635)
at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:372)
at org.springframework.orm.hibernate3.HibernateTemplate.save(HibernateTemplate.java:632)
at com.fenet.gddb.cds.service.datareneter.dao.CreditCareJGHisDAO.save(CreditCareJGHisDAO.java:47)
at com.fenet.gddb.cds.service.datareneter.bs.CreditCareJGHisBS.createCreditCareJG(CreditCareJGHisBS.java:21)
at com.fenet.gddb.cds.web.servlet.ExcelUploadServlet.upLoadCreditCareJG(ExcelUploadServlet.java:199)
at com.fenet.gddb.cds.web.servlet.ExcelUploadServlet.doPost(ExcelUploadServlet.java:86)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.fenet.gddb.cds.web.common.filter.CommonFilter.doFilter(CommonFilter.java:37)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:595)
Caused by: com.ibm.db2.jcc.c.SqlException: DB2 SQL error: SQLCODE: -204, SQLSTATE: 42704, SQLERRMC: DB2ADMIN.CDS_CREDITCAREJG_HIS
at com.ibm.db2.jcc.c.fg.e(fg.java:1596)
at com.ibm.db2.jcc.c.fg.a(fg.java:1206)
at com.ibm.db2.jcc.b.gb.g(gb.java:140)
at com.ibm.db2.jcc.b.gb.a(gb.java:39)
at com.ibm.db2.jcc.b.w.a(w.java:34)
at com.ibm.db2.jcc.b.vb.g(vb.java:139)
at com.ibm.db2.jcc.c.fg.n(fg.java:1177)
at com.ibm.db2.jcc.c.gg.eb(gg.java:1862)
at com.ibm.db2.jcc.c.gg.d(gg.java:2295)
at com.ibm.db2.jcc.c.gg.W(gg.java:457)
at com.ibm.db2.jcc.c.gg.executeUpdate(gg.java:440)
at org.hibernate.id.IdentityGenerator$GetGeneratedKeysDelegate.executeAndExtract(IdentityGenerator.java:73)
at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:33)
... 43 more
最后才发现,
原来是Hibernate 的Mapping文档写错了,数据库里根本没有DB2ADMIN.CDS_CREDITCAREJG_HIS这张表,表名本来应该是DB2ADMIN.CDS_CREDITCAREJG_HISTORY....
发表评论
-
ANTLR 学习
2012-05-02 10:54 798The most common gramma ... -
线程池实现
2012-04-26 17:44 775线程池有以下几个部分: 1.完成主要任务的一个或多个线程. ... -
Eclipse RCP
2012-04-19 13:42 747Combining editors and views wit ... -
观察者模式
2012-03-29 22:38 742观察者模式定义了对象之间的一对多的依赖。当一个对象改变状态时, ... -
设计模式之 策略模式 Strategy Pattern
2012-03-29 23:03 660策略模式定义了算法族, 分别封装起来,让它们之间可以互相替换, ... -
JS 创建对象
2012-03-22 09:37 812// 1. 原型方式function PC ... -
Spring配置文件
2012-03-10 16:17 859首先来看一个标准的Spring配置文件 applica ... -
<aop:aspectj-autoproxy />作用
2012-03-10 16:03 1759<aop:aspectj-autoproxy /& ... -
解决Dom4j中"The Node already has an existing parent"问题
2012-03-05 15:54 923常常需要在两个Document中互相复制Eleme ... -
2008~, 怎么可以留白 及一段有意思的话
2008-12-24 02:05 855前段时间发现JE可以把别的Blog的文章导过来,当下把自 ... -
周庄印象
2007-12-15 01:09 517一直想写些什么,却 ...
相关推荐
在执行数据库批量操作时,Hibernate抛出`SQLGrammarException`,表明SQL语法错误或数据库不支持当前操作。 **原因分析**: 这可能是由于Hibernate生成的SQL语句不符合目标数据库的语法规范,或者数据库驱动程序版本...
nested exception is org.hibernate.exception.SQLGrammarException: could not execute query 这个错误是由于SQL语句有错误,导致查询失败。解决方法是检查SQL语句的正确性,确保语句正确无误。 4. 严重: Error ...
**问题描述**:执行Hibernate操作时,如插入数据,遇到`org.hibernate.exception.SQLGrammarException: Could not execute JDBC batch update`异常。 **原因分析**:这通常是由于数据库表不存在或表结构不匹配引起...
nested exception is org.hibernate.exception.SQLGrammarException: could not execute query` 这个异常表明执行SQL查询时出现了语法错误。检查并修正相关的SQL语句,确保其符合SQL语法规范,并且与数据库表结构...
具体表现为在执行查询时抛出了`SQLGrammarException`,提示为`ORA-00907: 缺失右括号`,这通常意味着SQL语句中的语法错误,可能是括号没有正确配对。 首先,让我们深入理解问题的根源。Hibernate是Java平台上的一个...
在这个场景中,异常的根因是嵌套的“org.hibernate.exception.SQLGrammarException: could not execute query”,这是Hibernate在处理SQL语句时抛出的异常,通常与SQL语法错误或表结构不匹配有关。当从SQL Server...
3. **Exception in thread "main" org.hibernate.exception.SQLGrammarException: Could not execute JDBC batch update** Hibernate在执行数据库批处理更新时出现SQL语法错误,可能是由于数据库表不存在或结构不符...
### 错误二:org.hibernate.exception.SQLGrammarException: could not get next sequence value 此错误与Hibernate框架相关,当尝试获取数据库中的下一个序列值时出现语法错误。这通常是因为配置不当或数据库查询...
- **SQLGrammarException**: 执行 SQL 语句失败时抛出。 - **TransactionException**: 事务相关异常。 #### 八、最佳实践 - **代码规范**: 统一命名规则,遵循 Java 编码标准。 - **单元测试**: 编写单元测试验证...
- **SQLGrammarException**: 当SQL语法错误时抛出。 - **ConstraintViolationException**: 违反了数据库约束(如主键冲突)时抛出。 #### 十一、扩展与插件 - **拦截器(Interceptor)**: 用于拦截特定的事件,如对象...
- **SQLGrammarException**:执行SQL语句时发生的异常。 - **ConstraintViolationException**:违反数据库约束时抛出的异常。 #### 十、性能优化 - **查询优化**:合理使用索引、避免N+1查询等问题。 - **对象图...
nested exception is org.hibernate.exception.SQLGrammarException: could not execute query ``` **问题描述:** 这通常是因为Hibernate执行SQL查询时遇到了语法错误或者数据表结构不匹配等问题。 **解决方法:...
- **SQLGrammarException**:如果执行的 SQL 语句语法有误,则会抛出该异常。 - **ConstraintViolationException**:当违反数据库约束(如唯一性约束、外键约束等)时触发。 - **LockAcquisitionException**:在并发...
警告: SQL Error: 156, ...org.hibernate.exception.SQLGrammarException: could not execute query org.hibernate.util.JDBCExceptionReporter logExceptions 严重: 关键字 'user' 附近有语法错误。 的解决方案。
Exception in thread "main" org.hibernate.exception.SQLGrammarException: Could not execute JDBC batch update 或者org.springframework.jdbc.BadSqlGrammarException: Hibernate operation: could not insert: ...