• Caused by: java.sql.SQLException: Parameter index out of range (2 > number of parameters, which is 1).


    今天发现一个小细节,没注意就会报错,在xml中自定义sql语句时,里面不能有注释过得sql,简单的说就是:假如第一次写的sql是select * from table,但是在后面发现要写错了,那么只能把之前这一条删除掉,不能注释,如果注释就会报错,当然,这只是一个小错误而已,一般人可能不会犯....

    Caused by: org.apache.ibatis.type.TypeException: Could not set parameters for mapping: ParameterMapping{property='spuId', mode=IN, javaType=class java.lang.Object, jdbcType=null, numericScale=null, resultMapId='null', jdbcTypeName='null', expression='null'}. Cause: org.apache.ibatis.type.TypeException: Error setting non null for parameter #2 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 #2 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 (2 > number of parameters, which is 1).

    Caused by: org.apache.ibatis.type.TypeException: Error setting non null for parameter #2 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 #2 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 (2 > number of parameters, which is 1).

    Caused by: org.apache.ibatis.type.TypeException: Could not set parameters for mapping: ParameterMapping{property='spuId', mode=IN, javaType=class java.lang.Object, jdbcType=null, numericScale=null, resultMapId='null', jdbcTypeName='null', expression='null'}. Cause: org.apache.ibatis.type.TypeException: Error setting non null for parameter #2 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 #2 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 (2 > number of parameters, which is 1).

  • 相关阅读:
    Linux_文件权限
    离殇
    Oracle数据库软件标准版的一个限制:仅仅能用一个rman channel
    数据结构和算法设计专题之---推断两个链表是否相交并找出交点
    Test for Job (poj 3249 记忆化搜索)
    表达式求值
    HDOJ 2196 Computer 树的直径
    ListView的position的保持
    Django訪问量和页面PV数统计
    【oracle 11G Grid 】Crsctl start cluster 和 crsctl start crs 有差别么?
  • 原文地址:https://www.cnblogs.com/exce-ben/p/13306807.html
Copyright © 2020-2023  润新知