Home MyBatis报错,无效的列索引
Post
Cancel

MyBatis报错,无效的列索引

报错信息

1
2
3
4
5
6
7
8
9
10
11
nested exception is org.apache.ibatis.type.TypeException: 
Could not set parameters for mapping: ParameterMapping{property= ‘groupid’,
mode=IN, javaType=class java.lang.Object, jdbcType=null,
numericScale=null, resultMapld=‘null’, jdbcTypeName-=‘nl’,
expression= 'null}. Cause: org.apache.ibatis.type.TypeException: Error
setting non null for parameter #3 with JdbcType null. Try setting a
different JdbcType for this parameter or a different configuration
property. Cause: org.apache.ibatis.type.TypeException: Error setting non
null for parameter #3 with JdbcType null . Try setting a different
JdbcType for this parameter or a different configuration property. Cause:
java.sql.SQL Exception:无效的列索引

报错原因

使用了/*… */注释

解决方法

SQL本身没有问题,换一种注释方式即可

参考:SQL报错:无效的列索引

This post is licensed under CC BY 4.0 by the author.