Mybatis使用注解方式对数据库插入数据时,出现了以下异常:
TypeException: Could not set parameters for mapping: ParameterMapping{property='productStatus', mode=IN, javaType=class java.lang.Integer, jdbcType=null, numericScale=null, resultMapId='null', jdbcTypeName='null', expression='null'}. Cause: org.apache.ibatis.type.TypeException: Error setting non null for parameter #6 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 (6 > number of parameters, which is 5).
经过观察发现,sql语句里#后面多输入了一个空格。

本文探讨了在使用Mybatis注解方式操作数据库时,因SQL语句中#后多输入空格导致的TypeException,详细分析了错误原因并提供了解决方案。
5781

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



