mybatis出现无效的列类型
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出现无效的列类型的更多相关文章
- 【错误笔记】MyBatis SQLException: 无效的列类型: 1111
问题描述: org.springframework.jdbc.UncategorizedSQLException: Error setting null for parameter #1 with J ...
- [转]Mybatis出现:无效的列类型: 1111 错误
原文地址:http://www.cnblogs.com/sdjnzqr/p/4304874.html 在使用Mybatis时,不同的xml配置文件,有的会提示:无效的列类型: 1111 比如这个sql ...
- Mybatis出现:无效的列类型: 1111 错误
在使用Mybatis时,不同的xml配置文件,有的会提示:无效的列类型: 1111 比如这个sql: update base.sys_person t set t.rybh=#{rybh},t.xm= ...
- Mybatis:使用bean传值,当传入值为Null时,提示“无效的列类型”的解决办法
问题描述:在使用mybatis对数据库执行更新操作时,parameterType为某个具体的bean,而bean中传入的参数为null时,抛出异常如下:org.mybatis.spring.MyBat ...
- 操作MyBatis引发Error setting null for parameter #X with JdbcType OTHER .无效的列类型
再用MyBatis操作Oracle的时候,传入null值而引发的错误 异常信息: org.springframework.jdbc.UncategorizedSQLException: Error s ...
- Java.sql.SQLException: 无效的列类型: 1111
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.type.TypeException: ...
- oracle: jdbcTypeForNull configuration property. Cause: java.sql.SQLException: 无效的列类型: 1111
https://www.cnblogs.com/mmlw/p/5808072.html org.mybatis.spring.MyBatisSystemException: nested except ...
- 又一个无效的列类型错误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 ...
- 报错:无效的列类型: 1111;must be specified for all nullable parameters.
org.springframework.jdbc.UncategorizedSQLException: Error setting null parameter. Most JDBC drivers ...
随机推荐
- JavaScript 高级特性
1. 原型Prototype 1.1 构造函数 所谓"构造函数",其实就是一个普通函数,但是内部使用了this变量.对构造函数使用new运算符,就能生成实例,并且this变量会绑定 ...
- Android Studio 1.0~3.3加载android源码 笔记
一. AS3.3上出现问题: 1. File Z:\Project\****\***\AndroidManifest.xml doesnt exist 分析引用: ------------------ ...
- glide 长方形图片显示圆角问题
目前业务是RecyclerView嵌套RecyclerView,子RecyclerView里面显示图片,图片显示方式又分为 多图和单图显示方式(这个是已经调试好的效果) 测试显示结果只有单张图片不显示 ...
- socket开发总结
1.connect 阻塞socket connect时会等待返回结果,等于0表示成功,小于0表示失败. 非阻塞socket connect时会立刻返回结果,等于0表示成功,小于0且errno == E ...
- SurfaceView绘图时刷新问题,尝试各种办法无法解决,请教高手
/** * */ 源码:http://pan.baidu.com/s/1i3FtdZZ 画图时最左面,第一帧总是出现一个黑条,其它的帧没有问题package com.macrosoft.testewa ...
- springBoot和c3p0的整合
首先创建c3p0的数据源类 package com.example.demo.config; import javax.sql.DataSource; import org.mybatis.sprin ...
- Spring boot 的 properties 属性值配置 application.properties 与 自定义properties
配置属性值application.properties 文件直接配置: com.ieen.super.name="MDD" 自定义properties文件配置:src/main/r ...
- 主动收入VS被动收入
主动收入VS被动收入 天差地別 主动收入是指有工作才有收入, 不工作就没有的收入, 它是一种临时性收入, 做一次工作得到一次回报. 主动收入的最大的特点是 “用时间换钱”, 就像很多上班族有一份月薪6 ...
- golang初识3 - func
1. 功能块(function block) 格式: func function_name( [parameter list] ) [return_types] { //body } 与delphi的 ...
- java.lang.StackOverflowError
在开发中经常会遇到内存溢出的情况,大部分原因是因为:代码中有死循环.过度递归等情况 解决办法:看报错 找到是因为死循环还是过度递归,改掉即可 我的报错原因是使用了 new Gson.().toJson ...