码迷,mamicode.com
首页 > 其他好文 > 详细

mybatis 无效的列类型

时间:2015-05-18 16:55:11      阅读:142      评论:0      收藏:0      [点我收藏+]

标签:mybatis      exception   xml   sql   

项目报错为:
[FaultEvent fault=[RPC Fault faultString="org.springframework.jdbc.UncategorizedSQLException : Error setting null parameter.  Most JDBC drivers require that the JdbcType must be specified for all nullable parameters. Cause: java.sql.SQLException: 无效的列类型
; uncategorized SQLException for SQL []; SQL state [null]; error code [17004]; 无效的列类型; nested exception is java.sql.SQLException: 无效的列类型" faultCode="Server.Processing" faultDetail="null"] messageId="406BB9C8-A70D-B31C-65E7-573E4B6DDBB4" type="fault" bubbles=false cancelable=true eventPhase=2]


XML文件updateSQL语句为:

技术分享

实体类对应的属性设置为:

技术分享

原因:

MyBatis 插入空值时,需要指定JdbcType 
mybatis insert空值报空值异常,但是在pl/sql不会提示错误,主要原因是mybatis无法进行转换


XML文件中SQL语句改为:

技术分享

mybatis 无效的列类型

标签:mybatis      exception   xml   sql   

原文地址:http://blog.csdn.net/baidu_25310663/article/details/45822067

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!