org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.builder.BuilderException: Error resolving JdbcType. Cause: java.lang.IllegalArgumentException: No enum constant org.apache.ibatis.type.JdbcType.Intege No enum constant:提示说mybatis没有Integer该类型的枚举常量,导致该异常抛出 数据库类型和Java类型之间的关系: DBC Type Java Type CHAR String VARCHAR String LONGVARCHAR String NUMERIC java.math.BigDecimal DECIMAL java.math.BigDecimal BIT boolean BOOLEAN boolean TINYINT byte SMALLINT short INTEGER int BIGINT long REAL float FLOAT double DOUBLE double BINARY byte[] VARBINARY byte[] LONGVARBINARY byte[] DATE java.sql.Date TIME java.sql.Time TIMESTAMP java.sql.Timestamp CLOB Clob BLOB Blob ARRAY Array DISTINCT mapping of underlying type STRUCT Struct REF Ref DATALINK java.net.URL[color=red][/color] 而MyBatis所支持的jdbcType类型有一下几种: BIT、 FLOAT、CHAR、TIMESTAMP、OTHER、 UNDEFINED TINYINT、REAL、VARCHAR、BINARY、BLOB、 NVARCHAR SMALLINT、DOUBLE、LONGVARCHAR、VARBINARY、CLOB、NCHAR INTEGER、NUMERIC、DATE、 LONGVARBINARY、BOOLEAN 、NCLOB BIGINT、DECIMAL、TIME、NULL、CURSOR 注意:在书写jabcType类型的时候,是有严格的大小写的区分的,否则会抛出上面的异常,即mybatis所定义的类型常量枚举不存在 场景重现:<!-- 批量新增 --> <insert id="insertAddBatchBillid" parameterType="map"> insert into tbc_specbill_target (billid,sms_type,state,updatetime,staff,mark_type,desc_info,attachproname,attachcompany,tag_count) values <foreach collection="param" item="i" separator=","> (#{i.col0,jdbcType=VARCHAR}, #{i.col1,jdbcType=VARCHAR}, 0, SYSDATE(),#{userName,jdbcType=VARCHAR},#{i.col2,jdbcType=VARCHAR},#{i.col3,jdbcType=VARCHAR},#{i.attachproname,jdbcType=VARCHAR}, #{i.attachcompany,#{i.col4,jdbcType=Integer}) //工作中偶遇的情景,导致异常产生,将jdbcType=Integer修改为jdbcType=INTEGER 后运行正常 </foreach> </insert>