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

Mybatis报错解决

时间:2018-01-15 18:47:01      阅读:487      评论:0      收藏:0      [点我收藏+]

标签:inpu   ber   set   term   插入   类型   tor   转换   key   

Caused by: org.apache.ibatis.type.TypeException: Could not set parameters for mapping: ParameterMapping{property=‘input‘, mode=IN, javaType=class java.lang.String, jdbcType=null, numericScale=null, resultMapId=‘null‘, jdbcTypeName=‘null‘, expression=‘null‘}. Cause: org.apache.ibatis.type.TypeException: Error setting non null for parameter #1 with JdbcType null . Try setting a different JdbcType for this parameter or a different configuration property. Cause: java.sql.SQLException: No operations allowed after statement closed.

解决:mybatis SQL语句指定数据类型,比如:#{lala,jdbcType=VARCHAR}

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

Mybatis报错解决

标签:inpu   ber   set   term   插入   类型   tor   转换   key   

原文地址:https://www.cnblogs.com/zhangdi666/p/8289123.html

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