关于“The error occurred while applying a parameter map.”的问题,
今天我也写一点,那就是找准改错的方向,不然小错费大事
我今天的错误:如下
更新userMain失败org.springframework.jdbc.BadSqlGrammarException: SqlMapClient operation;
bad SQL grammar []; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in com/hunai/pojo/sqlmap/umUserMain-sqlmap.xml.
--- The error occurred while applying a parameter map.
--- Check the UserMain.updateUmPwd-InlineParameterMap.
--- Check the statement (update failed).
--- Cause: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where mum.UM_UserID=37' at line 1
出错地方:
<update id="UserMain.updateUmPwd">
<![CDATA[
update
mi_user_main mum
set
mum.UM_Pwd=#1#,
where
mum.UM_UserID=#2#
]]>
</update>
遇到“The error occurred while applying a parameter map”这种错误,首先想到的是字段对应的错误,
但是像这种低价错误,iBATIS会很明确的指出出错的地方的。
这种想法应该排除的。
不过上面很明显说是bad SQL grammar ;
那就把这个语句粘贴到数据库做个测试,不能去瞎找,我今天就犯了很大的错误,
没有寻本求源,总感觉sql语法不会有问题,就去瞎忙活,看下传参是否出错呀,之类的,整了老半天,
最后实在想不出是什么地方出错,就到数据库测试语句,果然,根本性的原因还是sql语句,多了一个逗号
set
mum.UM_Pwd=#1#,
唉,真是惭愧呀,这么低级的错误本不该发生,可是,发生了,会让人很苦恼。
所以,方向与方法非常重要,少走弯路。
分享到:
相关推荐
实用开发工具Myeclipse,在启动tomcat时,不间断的会弹出 An internal error occurred during: "Calculating completion proposals...". java.lang.NullPointerException的错误对话框!
异常A generic error occurred in GDI+的解决办法
onvif网站下载修改后的wsdl和xsd文件
eclipse scala插件,第二部分
NULL 博文链接:https://zhongrf.iteye.com/blog/1964274
主要介绍了关于eclipse安装spring插件报错An error occurred while collecting items to be installed...解决方案,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面...
NULL 博文链接:https://cuisuqiang.iteye.com/blog/1769413
An unknown server-side error occurred while processing the command. Original error: Cannot verify the signature of 'C:\Program Files\Appium\resources\app\node_modules\appium\node_modules\appium-...
根据本人运维经验,结合openVPN社区相关案例,针对TAP-Windows-adapter安装失败“an error occured installing the TAP device driver”错误提示,提出五种解决方案
VS2005/VS2008软件发布问题:SignTool Error: An error occurred while attempting to sign 处理方法
myeclipse弹出an internal error occurred during:"initializing"java tooling.有时候myeclipse总是在保存的时候弹出错误,只要保存就弹出.本资源可以解决报错问题
用RSACryptoServiceProvider进行公钥解密时会出现“不正确的项”的错误,本类使用RSA PKCS#1 1.5的格式实现了公钥、私钥的双向加解密
tap windows。是安装在windows中的虚拟网卡的设备驱动。
本人实践,物超所值,一站式解决jmeter负载机环境问题,问题集合含: ... localhost.localdomain is a loopback address.An error occurred: Cannot start. localhost.localdomain is a loopback address.
对于DB2“SQL2421N 不允许表空间级备份,因为未启用前滚恢复。”解决方法
解决方法:An error occurred on the server when processing the URL. Please contact the system administrator 在WINDOWS7或SERVER2008上安装了IIS7.5,调试ASP程序时出现以下错误: An error occurred on the ...
win7_64eclispe插件 解决An internal error occurred during: "Map/Reduce location status updater". org/codehaus/jackson/map/JsonMappingException 重新编译包
IAR for stm8 debugger-support-files 解决问题===> An error occurred while retrieving GDI features: gdi-error [40201]: Can't access configuration database
报错内容:sbin/nginx: error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory 启动时如果报异常error while loading shared libraries: libpcre.so....