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. LAB1 partIV

    PartIV 实现 处理worker 失败情况. worker 处理失败,master 应该重新分配该任务给其他的worker 处理. rpc 失败情况复杂,可能worker 结果回应丢失了,也有可能 ...

  2. Windows自定义运行命令

    1 打开注册表regedit 2 找到:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths 3 新增项,自己运 ...

  3. [ZZ]AppiumForWindows 菜鸟计划合集

    AppiumForWindows 菜鸟计划 (一) Appium 材料包 AppiumForWindows 菜鸟计划 (二) 源码环境搭建及代码结构 AppiumForWindows 菜鸟计划 (三) ...

  4. MongoDB监控(常见监控方法及profile)-temp

    为什么要监控? 监控及时获得应用的运行状态信息,在问题出现时及时发现. 监控什么? CPU.内存.磁盘I/O.应用程序(MongoDB).进程监控(ps -aux).错误日志监控 1.4.1 Mong ...

  5. numpy学习笔记(四)

    (1)NumPy - 矩阵库 NumPy 包包含一个 Matrix库numpy.matlib.此模块的函数返回矩阵而不是返回ndarray对象. matlib.empty()返回一个新矩阵,而不初始化 ...

  6. altium designer 制作内部不铺铜的封装,如三极管下面禁止铺铜

    制作封装的时候,按P键或菜单栏中点击place选项点选Polygon Pour Cutout.画一个原件禁止铺铜区域即可.

  7. Python课程第四天作业

    1.定义一个函数,该函数可以实现控制台输入,最终返回一个int类型的正整数 def chr_to_int(): user_input = input('请输您要转换的字符串:') if user_in ...

  8. SpringBoot+Mybatis实现关联查询

    SpringBoot+Mybatis实现关联查询 今天学习了下Mybatis的动态查询,然后接着上次的Demo改造了下实现表的关联查询. 话不多说,开始今天的小Demo 首先接着上次的项目 https ...

  9. C#导出 Excel 时, 生成 CheckBox 控件

    在使用 Microsoft.Office.Interop.Excel 组件导出Excel 表格时,要把导出前的  CheckBox 控件一同导出到 excel 表格中,对于这个功能 看似很简单,但 M ...

  10. 数据传输流程和socket简单操作

    一.***C/S架构:客户端(client)/服务端(server)架构, B/S架构:浏览器(browser) / 服务端(server)架构 软件cs架构:浏览器,qq,微信,陌陌等等硬件cs架构 ...