package com.webapp.hanqi.test;

import java.util.Date;

import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.context.support.ClassPathXmlApplicationContext; import com.webapp.hanqi.dao.AppUserDao;
import com.webapp.hanqi.model.AppUser; class AppWebTest { ClassPathXmlApplicationContext c;
AppUserDao appUserDao; @Test
void test() {
AppUser user = new AppUser();
user.setUname("admin333");
user.setPword("123");
user.setCtime(new Date());
user.setRname("测试用户");
// user.setEmail("25673578@qq.com");
user.setCdkey("abc");
int u = appUserDao.insert(user);
System.out.println(u);
} @BeforeEach
void setUp() throws Exception {
c = new ClassPathXmlApplicationContext("conf/spring-all.xml");
appUserDao = c.getBean(AppUserDao.class);
} @AfterEach
void tearDown() throws Exception {
c.close();
} }

添加一条数据时, email列被报出无效的列类型的异常, 原因是mybatis在插入空值的时候需要指定jdbcType, 否则将无法进行转换

mybatis出现无效的列类型的更多相关文章

  1. 【错误笔记】MyBatis SQLException: 无效的列类型: 1111

    问题描述: org.springframework.jdbc.UncategorizedSQLException: Error setting null for parameter #1 with J ...

  2. [转]Mybatis出现:无效的列类型: 1111 错误

    原文地址:http://www.cnblogs.com/sdjnzqr/p/4304874.html 在使用Mybatis时,不同的xml配置文件,有的会提示:无效的列类型: 1111 比如这个sql ...

  3. Mybatis出现:无效的列类型: 1111 错误

    在使用Mybatis时,不同的xml配置文件,有的会提示:无效的列类型: 1111 比如这个sql: update base.sys_person t set t.rybh=#{rybh},t.xm= ...

  4. Mybatis:使用bean传值,当传入值为Null时,提示“无效的列类型”的解决办法

    问题描述:在使用mybatis对数据库执行更新操作时,parameterType为某个具体的bean,而bean中传入的参数为null时,抛出异常如下:org.mybatis.spring.MyBat ...

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

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

  6. Java.sql.SQLException: 无效的列类型: 1111

    org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.type.TypeException: ...

  7. oracle: jdbcTypeForNull configuration property. Cause: java.sql.SQLException: 无效的列类型: 1111

    https://www.cnblogs.com/mmlw/p/5808072.html org.mybatis.spring.MyBatisSystemException: nested except ...

  8. 又一个无效的列类型错误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 ...

  9. 报错:无效的列类型: 1111;must be specified for all nullable parameters.

    org.springframework.jdbc.UncategorizedSQLException: Error setting null parameter. Most JDBC drivers ...

随机推荐

  1. Node文件模块

    在上一篇文章中有提到,Node模块分为核心模块和文件模块,接下来就简单总结一下文件模块. 文件模块则是在运行时动态加载,需要完整的路径分析.文件定位.编译执行过程.速度相比核心模块稍微慢一些,但是用的 ...

  2. navigateTo、redirectTo、switchTap与reLaunch的区别

    wx.navigateTo:保留当前页,跳转到指定页,非tabBar:使用 wx.navigateBack 可以返回到当前的页面. wx.redirectTo:关闭当前页,跳转到指定页,非tabBar ...

  3. Windows 7无声音的解决方案

    在使用Windows7的过程中,可能会遇到系统没有声音的问题.导致此问题的原因有以下几点: (1)电脑没有配置声音输出设备: (2)未安装声卡驱动: (3)声音输出设备硬件发生故障: (4)扬声器被禁 ...

  4. MyBatis注解-动态SQL 一个 SqlProvider的demo

    Provider动态语言注解 MyBatis提供了多个注解如:@InsertProvider,@UpdateProvider,@DeleteProvider和@SelectProvider,这些都是建 ...

  5. 彻底解决windows10+matlab2018a调用libsvm时出现找不到编译器问题

    本文转载自:Shane Zhao博客(CSDN) https://blog.csdn.net/silence2015/article/details/53106156 个人申明,只是因为解决这个问题花 ...

  6. vue $refs 无法动态拼接,获取不到对象(转)

    原文地址: http://www.php.cn/js-tutorial-410304.html 本篇文章给大家带来的内容是关于vue $refs中不使用拼接的原因以及解决方法,有一定的参考价值,有需要 ...

  7. 请简单介绍一下BootStrap:

    1.轻量级的开发响应式页面的框架 2.全局CSS,组件,JS插件 3.栅格系统:将页面分为12个等分(CSS3@media媒体查询) 4.col-xs-*:手机屏幕 5.col-sm-*:平板 6.c ...

  8. JDK源码中,都有哪些NB的设计模式?

    转载:https://mp.weixin.qq.com/s/h88UxB9F2MkTbHqck3KQiQ 一.结构性模式: 1.适配器模式: 常用于将一个新接口适配旧接口 肥朝小声逼逼:在我们业务代码 ...

  9. 利用jvisualvm使用btrace进行线上调试案例

    用途:btrace主要用于线上调试.通过btrace,可在不改动代码的前提下,方便的发现以下问题: 1.定位性能慢的接口服务: 2.实时打印堆栈信息,定位死锁位置: 3.定位占用大量内存空间的代码块: ...

  10. Disconnected from the target VM, address: '127.0.0.1:57178', transport: 'socket'

    idea 执行测试单元debug时控制台出现:Disconnected from the target VM, address: '127.0.0.1:57178', transport: 'sock ...