Cause: java.sql.SQLException: 无效的列类型
来源:互联网 发布:js原生代码隐藏div 编辑:程序博客网 时间:2024/05/15 23:21
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.type.TypeException: Could not set parameters for mapping: ParameterMapping{property='cn_user_token', 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 #4 with JdbcType OTHER . Try setting a different JdbcType for this parameter or a different jdbcTypeForNull configuration property. Cause: java.sql.SQLException: 无效的列类型
at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:76)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
Caused by: org.apache.ibatis.type.TypeException: Could not set parameters for mapping: ParameterMapping{property='cn_user_token', 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 #4 with JdbcType OTHER . Try setting a different JdbcType for this parameter or a different jdbcTypeForNull configuration property. Cause: java.sql.SQLException: 无效的列类型
Caused by: org.apache.ibatis.type.TypeException: Error setting null for parameter #4 with JdbcType OTHER . Try setting a different JdbcType for this parameter or a different
<![CDATA[ insert into t_yp_province (fid,fname,fnumber,fsimpleName,fdescription,fcreateTime,flastUpdateTime,fdirect) values ( #{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{number,jdbcType=VARCHAR}, #{simpleName,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, #{createTime,jdbcType=DATE}, #{lastUpdateTime,jdbcType=DATE}, #{direct,jdbcType=NUMERIC} ) ]]> </insert>;
at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:76)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
Caused by: org.apache.ibatis.type.TypeException: Could not set parameters for mapping: ParameterMapping{property='cn_user_token', 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 #4 with JdbcType OTHER . Try setting a different JdbcType for this parameter or a different jdbcTypeForNull configuration property. Cause: java.sql.SQLException: 无效的列类型
Caused by: org.apache.ibatis.type.TypeException: Error setting null for parameter #4 with JdbcType OTHER . Try setting a different JdbcType for this parameter or a different
mybatis 插入空值時需要指定jdbcType
报错内容:
### Cause: org.apache.ibatis.type.TypeException: Error setting null for parameter #10 with JdbcType OTHER . Try setting a different JdbcType for this parameter or a different jdbcTypeForNull configuration property. Cause: java.sql.SQLException: 无效的列类型
MyBatis 插入空值时,需要指定JdbcType
mybatis insert空值报空值异常,但是在pl/sql不会提示错误,主要原因是mybatis无法进行转换,
解决方法:
在insert语句中,增加jdbcType解决问题
<insert id="save" parameterType="Province">
阅读全文
0 0
- Cause: java.sql.SQLException: 无效的列类型
- a different jdbcTypeForNull configuration property. Cause: java.sql.SQLException: 无效的列类型: 1111
- java.sql.SQLException: 无效的列类型
- java.sql.SQLException: 无效的列类型
- java.sql.SQLException: 无效的列类型
- Cause: java.sql.SQLException: 无效的列类型: 1111(Mybatis中insert插入空值时,需要指定JdbcType)
- java.sql.SQLException: 无效的列类型 PreparedStatement.setObject
- java.sql.SQLException: 无效的列类型: 1111
- java.sql.SQLException: 无效的列类型: 1111
- mybatis java.sql.SQLException: 无效的列类型
- java.sql.SQLException: 无效的列索引
- java.sql.SQLException: 无效的列索引
- java.sql.SQLException: 无效的列索引
- java.sql.SQLException: 无效的列索引
- java.sql.SQLException: 无效的列索引
- java.sql.SQLException: 无效的列索引
- java.sql.SQLException: 无效的列索引
- java.sql.SQLException: 无效的列索引
- 快速排序java
- 阿里云Cent OS服务器搭建环境jdk1.7+mysql+tomcat7.0
- iOS tableView cell的分割线设置
- Retrofit2.0使用
- Eclipse 安装scala插件
- Cause: java.sql.SQLException: 无效的列类型
- 征信良好贷款秒拒?你可能上了“灰名单”!
- android webview 保存cookie
- Android与LinuxC目录创建以及文件读写操作
- 工作语录
- JSP里的basePath
- Java-查看JVM从哪个JAR包中加载指定类
- JS中的队列(queue)和栈(stack)
- Android中的Acitivity