Caused by: org.apache.ibatis.type.TypeException: Error setting non null for parameter #2 with JdbcType null . Try setting a different JdbcType for this parameter or a different configuration property. Cause: java.sql.SQLException: Parameter index out of range (2 > number of parameters, which is 1).
解决
<if test="activityTitle !=null">
ad.activity_title LIKE '%#{activityTitle}%'
</if>
改成
<if test="activityTitle !=null">
ad.activity_title LIKE '%${activityTitle}%'
</if>
本文介绍了在使用MyBatis时遇到的`org.apache.ibatis.type.TypeException`,该异常通常发生在尝试为不存在的参数设置非空值时。通过分析错误信息,问题出在SQL语句中使用了错误的参数占位符。解决方案是将`#{activityTitle}

被折叠的 条评论
为什么被折叠?



