Error setting null for parameter #10 with JdbcType

 

turn:

Error setting null for parameter #10 with JdbcType OTHER .

JdbcType specify a null value when inserted mybatis
Error contents:
### Cause: org.apache.ibatis.type.TypeException: Error setting null for parameter #10 with JdbcType OTHER . Try setting a different JdbcType for this parameter or a different jdbcTypeForNull configuration property. Cause: java.sql.SQLException: 无效的列类型
 
When inserting nulls MyBatis, specify JdbcType
mybatis insert null null values ​​reported abnormal, but in pl / sql will not prompt an error, mainly due to mybatis can not be converted,
 
Solution:
 
In the insert statement, the increase jdbcType solve the problem
 
<insert id="save" parameterType="Province">
  <![CDATA[
  insert into t_yp_province
  (fid,fname,fnumber,fsimpleName,fdescription,fcreateTime,flastUpdateTime,fdirect)
  values
  ( #{id,jdbcType=VARCHAR},
   #{name,jdbcType=VARCHAR},
   #{number,jdbcType=VARCHAR},
   #{simpleName,jdbcType=VARCHAR},
   #{description,jdbcType=VARCHAR},
   #{createTime,jdbcType=DATE},
   #{lastUpdateTime,jdbcType=DATE},
   #{direct,jdbcType=NUMERIC}
  )  
  ]]>
 </insert>;

Guess you like

Origin www.cnblogs.com/libin6505/p/11579004.html
Recommended