美文网首页工作生活
Cause: java.sql.SQLException: 无效

Cause: java.sql.SQLException: 无效

作者: 听说昨夜星子坠落 | 来源:发表于2019-07-02 14:41 被阅读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=指定类型}

相关文章

网友评论

    本文标题:Cause: java.sql.SQLException: 无效

    本文链接:https://www.haomeiwen.com/subject/zhizcctx.html