本文主要是介绍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 java.sql.SQLException: Invalid column type: 1111的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!