转:

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. 链表实现队列(python)

    # -*- coding: utf-8 -*- from collections import deque class Node(object): def __init__(self, value=N ...

  2. 《Hello--world团队》第三次作业:团队项目的原型设计

    项目 内容 这个作业属于哪个课程 2016级计算机科学与工程学院软件工程(西北师范大学) 这个作业的要求在哪里 实验七 团队作业3:团队项目原型设计与开发 团队名称 <hello--world团 ...

  3. CentOs 6语言改成中文

    1.在root权限下 切换到root下:su - root 查看当前语言环境:locale -a  (注意中间有空格) 如果看到 zh_CN.UTF-8(这个是中文简体)说明你的系统支持中文语言: 没 ...

  4. java UDP 通信:服务端与客服端

    import java.io.IOException; import java.net.DatagramPacket; import java.net.DatagramSocket; import j ...

  5. Mybatis的简单搭建

    1.官方网址 http://www.mybatis.org/mybatis-3/zh/getting-started.html 2.导入jar包 3.根据官方文档,首先写mybatis-config. ...

  6. Python 操作Sonqube API 获取检测结果并打印

    1.需求:每次Sonqube检查完毕后,需要登陆才能看到结果无法通过Jenkins发布后直接看到bug 及漏洞数量. 2.demo:发布后,可以将该项目的检测结果简单打印出来显示,后面还可以集成钉钉发 ...

  7. Scrapy框架的八个扩展

    一.proxies代理 首先需要在环境变量中设置 from scrapy.contrib.downloadermiddleware.httpproxy import HttpProxyMiddlewa ...

  8. STM32F10XX学习笔记的石墨连接

    https://shimo.im/docs/QHGRrWxbeb0NiBm9/ <STM32F10X系列笔记>,可复制链接后用石墨文档 App 打开

  9. 在Vue中加入国际化(i18n)中英文功能

    1.npm安装方法 npm install vue-i18n --save 2.在src资源文件下创建文件夹i18n,i18n下面创建index.js文件,引入VueI18n和导入语言包(按开发需求可 ...

  10. jq导航

    做外部前端都会用到导航栏应用 一般导航应用会鼠标碰到变颜色  或子导航出现 下面为基本的导航 <div class="header"> <ul style=&qu ...