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 ...
随机推荐
- MongoDB监控(常见监控方法及profile)-temp
为什么要监控? 监控及时获得应用的运行状态信息,在问题出现时及时发现. 监控什么? CPU.内存.磁盘I/O.应用程序(MongoDB).进程监控(ps -aux).错误日志监控 1.4.1 Mong ...
- [转][C#]服务安装卸载命令
c:\windows\microsoft.net\Framework\v2.0.50727\installutil.exe [/u] X:\服务.exe
- selenium常用的API
打开浏览器 driver.get("http://www.baidu.com") 最大化浏览器 driver.maximize_window() 关闭浏览器 driver.quit ...
- paiza
<?php $str1 = ('paiza'); $str2 = ('apple'); $str3 = ('letter'); function bigTower($str1, $str2, $ ...
- Django框架之中间件与Auth
Django框架之中间件与Auth模块一 cbv加装饰器 -先导入:from django.utils.decorators import method_decorator -1 可以在方法上加装饰器 ...
- Android 开发 启动activity并且将前面activity全部清空
方法一: Intent intent = new Intent(A.this,B.class); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | I ...
- 关于Float.parseFloat()的一点探讨
最近在解决线上的bug时,遇到一个问题. 第三方传过来的课程编码时4214410000,然而我们存进数据库的值却变成了4214409980.查遍了所有的代码都查不到有对这个值修改的代码.最后,通过打印 ...
- MAIL服务器搭建
一,邮件服务: 优 点 缺 点 应 用 sendmail 有点年代久远,稳定功能多 太过于臃肿,配置文件多且繁琐 6以前默认 postfix 优点更稳定,且交轻便 发布年限较短,市场占有率低 ...
- vue-cli3 一直运行 /sockjs-node/info?t= 解决方案
sockjs-node 是一个JavaScript库,提供跨浏览器JavaScript的API,创建了一个低延迟.全双工的浏览器和web服务器之间通信通道. 服务端:sockjs-node(https ...
- Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty 报错
项目中遇到的获取https的数据接口数据时,Unexpected error: java.security.InvalidAlgorithmParameterException: the trustA ...