工作生活

Cause: java.sql.SQLException: 无效

2019-07-02  本文已影响0人  听说昨夜星子坠落

错误:

“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=指定类型}

上一篇 下一篇

猜你喜欢

热点阅读