Mybatis報錯解決
阿新 • • 發佈:2018-01-15
lang allow jdbc closed div ava upd int jdb
Caused by: org.apache.ibatis.type.TypeException: Could not set parameters for mapping: ParameterMapping{property=‘input‘, 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 non null for parameter #1 with JdbcType null . Try setting a different JdbcType for this parameter or a different configuration property. Cause: java.sql.SQLException: No operations allowed after statement closed.
解決:mybatis SQL語句指定數據類型,比如:#{lala,jdbcType=VARCHAR}
原因:MyBatis 插入空值時,需要指定JdbcType
mybatis insert,update空值報空值異常,但是在pl/sql不會提示錯誤,主要原因是mybatis無法進行轉換,
Mybatis報錯解決