使用mybatis報錯:Error setting non null for parameter #4 with JdbcType TIMESTAMP
阿新 • • 發佈:2018-10-31
一次性報的異常主要有以下幾個:
java.lang.RuntimeException: org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.type.TypeException:
Could not set parameters for mapping: ParameterMapping{time=’time’, 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 #4 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 (4 > number of parameters, which is 3).
最後發現原來是。。。
mapper.xml對映檔案裡有註釋!!!!!
把註釋刪掉,一切OK!