转:

Error setting null for parameter #10 with JdbcType OTHER .

2014年02月23日 11:00:33 厚积 阅读数 58535
 
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">
  <![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>;

Error setting null for parameter #10 with JdbcType的更多相关文章

  1. 又一个无效的列类型错误Error setting null for parameter #7 with JdbcType NULL . Try setting a different JdbcType for this parameter or a different jdbcTypeForNull configuration property. Cause: java.sql.SQLExcept

    在更新数据时候出现的错误 更新代码如下: <update id="modify" parameterType="Standard"> update ...

  2. 操作MyBatis引发Error setting null for parameter #X with JdbcType OTHER .无效的列类型

    再用MyBatis操作Oracle的时候,传入null值而引发的错误 异常信息: org.springframework.jdbc.UncategorizedSQLException: Error s ...

  3. log4net:ERROR ConfigureFromXml called with null 'element' parameter

    场景重现 ASP.NET Core 下集成 log4net 时, 运行时报错如下: log4net:ERROR ConfigureFromXml called with null 'element' ...

  4. Cause: org.apache.ibatis.executor.ExecutorException: Error getting generated key or setting result to parameter object. Cause: java.sql.SQLException: 不支持的特性

    mybatis插入数据时报错: Cause: org.apache.ibatis.executor.ExecutorException: Error getting generated key or ...

  5. MyBatis报错—Type handler was null on parameter mapping for property 'createTime'. It was either not specified and/or could not be found for the javaType (javax.xml.crypto.Data) : jdbcType (null) combina

    原因是:在创建实体类的时候吧date类型写成data导致类型不匹配 Type handler was null on parameter mapping for property 'createTim ...

  6. Error: Error setting TTL index on collection : sessions

    Error: Error setting TTL index on collection : sessions 一.步骤一: 这个问题一般是直接升级 mongodb和connect-mongo的版本为 ...

  7. zepplin0.7.2报错ERROR, exception: null, result: %text java.lang.NullPointerException的处理

    zepplin0.7.2报错ERROR, exception: null, result: %text java.lang.NullPointerException的处理 问题描述: 使用zeppli ...

  8. OgnlValueStack:49 - Error setting expression 'sfjmyh.zdyx6' with value '[Ljava.lang.String;@28d320d6'

    作过户管理流程时,提交表单后控制台显示如下错误 : WARN com.opensymphony.xwork2.ognl. OgnlValueStack:60 - Error setting expre ...

  9. Unexpected Exception caught setting 'username' on 'class com.bj186.crm.web.action.UserAction: Error setting expression 'username' with value ['艾格尼丝', ]

    问题场景: 在使用表单向Action传递数据的时候, 遇到了这个问题, 导致了空指针异常. 问题描述: 10:14:56.622 [http-nio-8080-exec-45] ERROR com.o ...

随机推荐

  1. (2) openstack--keystone

    yun1 OpenStack packages yum install python-openstackclient -y yum install openstack-selinux SQL data ...

  2. iptables详解(5)iptables的icmp扩展

    ICMP(Internet Control Message Protocol)Internet控制报文协议.它是TCP/IP协议簇的一个子协议,用于在IP主机.路由器之间传递控制消息.控制消息是指网络 ...

  3. 聊聊MVCC多版本并发控制

    一.介绍 MVCC只在RR和RC 2个隔离级别下才能工作.MySQL的大多数事务存储引擎实现的都不是简单的行级锁机制.基于提升并发性能的考虑,它们一般都同时实现了MVCC. 通俗的来讲,MVCC是行级 ...

  4. Spring核心概念和案例

    一.Spring概念 1.Spring框架概述 轻量级的Java EE开源框架,它是由Rod Johnson为了解决企业应用程序开发的复杂性而创建, Spring框架提供了一个开发平台,用于整合其他技 ...

  5. IDEA2018创建SpringBoot无法连接https://start.spring.io

    这是由于spring-boot需要访问https://start.spring.io外网,但是由于国内的局域网限制导致的. 解决办法: 进入到IDEA的setting 搜索 HTTP Proxy 选择 ...

  6. Oracle 11g 禁用 SQL Tuning Advisor 与 auto space advisor

    生产上有一套11g数据库alert.log报错ORA-16957: SQL Analyze time limit interrupt.  查询MOS相关文档Troubleshooting: ORA-1 ...

  7. vue报错 :NavigationDuplicated {_name: "NavigationDuplicated", name: "NavigationDuplicated"}

    解决的几种办法 https://blog.csdn.net/weixin_43202608/article/details/98884620 这个适合所有vue的UI框架 在main.js下添加一下代 ...

  8. 在qml中使用model给委托对象MapPolylIne的path属性赋值。

    遇到两个崩溃的问题. 1.A线程中给赋值了变量 listA, 线程B中使用函数Add(QList<GeoPath> &list),由于在其函数中调用了list.at(index), ...

  9. jQuery的ajax请求express服务器返回数据

    html页面 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UT ...

  10. vue中封装一个倒计时

    <template> <div class="countDownBox"> <div class="row resetStyle" ...