开发时,在操作数据库时 报以下错误
org.apache.ibatis.type.TypeException:Could not set parameters for mapping Cause: Error setting null for parameter #2 with JdbcType OTHER . Try setting a different JdbcType for this parameter or a different jdbcTypeForNull configuration property. Cause: java.sql.SQLException: 无效的列类型: 1111
当前报错是因为参数address为null,在插入数据库时报错
insert into test(id,name,address) values(#{id},#{name},#{address})
此时需要调整一下sql语句即可
2.大于小于号insert into test(id,name,address) values(#{id},#{name},#{address,jdbcType=VARCHAR})
mybatis中不可直接使用><=
方法一:转义> >
< <
>= >=
<= <=
方法二:用符号AND current_count >= #{count}
AND current_count >= #{count}
]]>



