把sql输出后,放到PLSQL中运行正常。 com.ibatis.common.jdbc.exception.NestedSQLException:

com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in ../classes/cn/cucsi/xml/H1DataDeal.xml.
--- The error occurred while applying a parameter map.
--- Check the cfupdate-InlineParameterMap.
--- Check the statement (update failed).
--- Cause: java.sql.SQLException: ORA-00900: invalid SQL statement
at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeUpdate(MappedStatement.java:107)
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.update(SqlMapExecutorDelegate.java:457)
at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.update(SqlMapSessionImpl.java:90)
at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.update(SqlMapSessionImpl.java:94)
at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.update(SqlMapClientImpl.java:70)
at cn.cucsi.dao.IndexTaskDAO.cfupdate(IndexTaskDAO.java:450)
at cn.cucsi.timer.Cuofan.work(Cuofan.java:57)
at cn.cucsi.action.IndexTask.exe(IndexTask.java:53)
at cn.cucsi.action.IndexTask.executeInternal(IndexTask.java:30)
at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86)
at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:529)
Caused by: java.sql.SQLException: ORA-00900: invalid SQL statement
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:582)
at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1983)
at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1141)
at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2149)
at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:2032)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2894)
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:608)
at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:684)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.ibatis.common.jdbc.logging.PreparedStatementLogProxy.invoke(PreparedStatementLogProxy.java:62)
at $Proxy150.execute(Unknown Source)
at com.ibatis.sqlmap.engine.execution.SqlExecutor.executeUpdate(SqlExecutor.java:80)
at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.sqlExecuteUpdate(MappedStatement.java:216)
at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeUpdate(MappedStatement.java:94)
... 11 more

java.sql.SQLException: ORA-00900: invalid SQL statement
提示是无效的SQL语句,看看xml文件中id为cfupdate的语句,是SQL写错了,或者是对应的resultMap有问题。追问

sql没问题。输出后放在PLSQL中执行正常,那个resultMap怎么看是什么问题或者怎么解决呢?

追答

你看看你在resultMap中的字段是不是在查询语句中都有查询到。使用resultMap的时候,查询语句的字段可以比resultMap映射的多,但是resultMap映射不能比查询的字段多。
像下面这种情况就会出错。

select id,name
from table1

追问

我这个是update的sql,select的没问题。

追答<statement id="cfupdate" parameterClass="java.util.Map">
<![CDATA[
$sql$
]]>
</statement>



像你这种语句,就不能这么写了吧。

你试试上面那么写好使不。

我们项目里是用的statement语句是好使的。

温馨提示:答案为网友推荐,仅供参考
第1个回答  2013-04-17
The error occurred while applying a parameter map 第三行,好像是说参数的map,你看看是不是 参数写错了。

相关了解……

你可能感兴趣的内容

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 非常风气网