oracle java.sql.SQLException: Invalid column type: 1111

1.遇到的问题

org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.type.TypeException: Could not set parameters for mapping: ParameterMapping{property='uuid', 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 null for parameter #1 with JdbcType OTHER . Try setting a different JdbcType for this parameter or a different jdbcTypeForNull configuration property. Cause: java.sql.SQLException: Invalid column type: 1111
    at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:77)
    at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:446)
    at com.sun.proxy.$Proxy124.selectList(Unknown Source)
    at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:230)
    at com.baomidou.mybatisplus.core.override.PageMapperMethod.executeForMany(PageMapperMethod.java:172)
    at com.baomidou.mybatisplus.core.override.PageMapperMethod.execute(PageMapperMethod.java:85)
    at com.baomidou.mybatisplus.core.override.PageMapperProxy.invoke(PageMapperProxy.java:64)
    at com.sun.proxy.$Proxy125.getSsgRequestBeanByUuidId(Unknown Source)

2.解决办法 

 mybatis 查询参数传了空,主要使用了注解查询方式,如下:

@Select("SELECT * FROM t_list WHERE uuid = #{uuid}")

 改为

@Select("SELECT * FROM t_list WHERE uuid = #{uuid,jdbcType=VARCHAR}")

由此问题解决。 

你可能感兴趣的:(oracle,数据库)