一、现象描述
今天在开发过程中遇到一个问题就是使用MyBatis插入数据时,死活插不进去。数据都有传递啊,为啥啊?碰到这些问题总有点懵逼,具体报错信息如下:
org.apache.ibatis.exceptions.PersistenceException:
### Error updating database. 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: 无效的列类型
### The error may exist in UserMapper.xml
### The error may involve com.queen.mybatis.mapper.UserMapper.addUserMap-Inline
### The error occurred while setting parameters
### SQL: insert into t_user(id,loginId,userName,role,note) values(?,?,?,?,?)
### 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: 无效的列类型
at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:26)
at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:154)
at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:141)
at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:51)
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java: