Cause: java.sql.SQLException: 无效的列类型: 1111

错误:

“nested exception is org.apache.ibatis.type.TypeException: Could not set parameters for mapping: ParameterMapping{property=’dept_id’, mode=IN, javaType=class java.lang.String, jdbcType=null, numericScale=null, resultMapId=’null’, jdbcTypeName=’null’, expression=’null’}. Cause: org.apache.ibatis.type.TypeException: Error setting null for parameter #3 with JdbcType OTHER . Try setting a different JdbcType for this parameter or a different jdbcTypeForNull configuration property. Cause: java.sql.SQLException:无效的列类型: 1111”

原因:

当参数为null时,对于mybatis,如果进行操作的时候,没有指定jdbctype类型的参数,mybatis指定的默认jdbctype=other将会抛出异常

解决:

#{参数名,jdbcType=指定类型}

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容