(后端)org.springframework.dao.EmptyResultDataAccessException: Incorrect result size: expected 1,actual 0
两种方案:
用queryForList方法替换queryForObject或者queryForMap,因为这两个方法必须要有值,不能为空。
把这个异常捕获,用try/catch。
- 这个查询的结果是null,没有数据所以就提示acual 为0.而查询的时候是期望查询有结果有记录,并且记录数是1. spring 这个查询中没有查询到数据就报错。解决方案就是要查询有结果,或者换一种查询方式。
(后端)org.springframework.dao.EmptyResultDataAccessException: Incorrect result size: expected 1,actual 0的更多相关文章
- QueryError:Incorrect result size: expected 1, actual 0
1.错误描述 QueryError:Incorrect result size: expected 1, actual 0 2.错误原因 3.解决办法
- ORA-00001:unique constraint violated 以及 Incorrect result size: expected 1, actual 0
往数据库中插入数据时报错: www.2cto.com ORA-00001: unique constraint (IDX_CARTON_HEADER)violated. 即往CARTON_ ...
- org.springframework.dao.EmptyResultDataAccessException
public Wcrash getWcrashInfo(int id) { String sql = "select plateform_id,android_version,app_ver ...
- 使用JdbcTemplate报 Incorrect column count: expected 1, actual 5错误解决
Incorrect column count: expected 1, actual 5 在使用jdbc的querForObject queryForList的时候,出现Incorrect colum ...
- Incorrect column count: expected 1, actual 5,JdbcTemplate queryForList 出错
spring JdbcTemplate queryForList 出错 Incorrect column count: expected 1, actual 5 >>>>&g ...
- Incorrect column count: expected 1, actual 5
在使用jdbc的querForObject queryForList的时候,出现Incorrect column count: expected 1, actual 5 比如 String sql = ...
- Incorrect column count: expected 1, actual 2
List<Long> idList = queryForList("ass.pageQuery_sgIds", paramMap, Long.class); 报错:In ...
- Incorrect column count: expected 1, actual 6
JdbcTemplate使用时出现了一些问题: 解决办法:
- java.lang.RuntimeException: org.springframework.dao.DuplicateKeyException:
java.lang.RuntimeException: org.springframework.dao.DuplicateKeyException: ### Error updating databa ...
随机推荐
- Spring 中初始化一个Bean对象时依赖其他Bean对象空指针异常
1. Bean依赖关系 一个配置类的Bean,一个实例Bean: 实例Bean初始化时需要依赖配置类的Bean: 1.1 配置类Bean @ConfigurationProperties(prefix ...
- centos安装守护进程工具supervisor
安装命令 yum install supervisor 启动守护进程 supervisord -c /etc/supervisord.conf 切换至/etc/supervisord.d目录下 写一个 ...
- spring boot -thymeleaf-日期转化
<span th:text="${#dates.format(date)}" ></span><span th:text="${#dates ...
- 课程四(Convolutional Neural Networks),第四 周(Special applications: Face recognition & Neural style transfer) —— 2.Programming assignments:Art generation with Neural Style Transfer
Deep Learning & Art: Neural Style Transfer Welcome to the second assignment of this week. In thi ...
- Python 【web框架】之Flask
flask 是Python实现的轻量级web框架.没有表单,orm等,但扩展性很好.很多Python web开发者十分喜欢.本篇介绍flask的简单使用及其扩展. 文中示例源码已经传到github:h ...
- vue.js的项目实战
欢迎大家前往腾讯云+社区,获取更多腾讯海量技术实践干货哦~ 本文由蔡述雄发表于云+社区专栏 需求背景 组件库是做UI和前端日常需求中经常用到的,把一个按钮,导航,列表之类的元素封装起来,方便日常使用, ...
- sql 表连接
join (inner join ) 注释:INNER JOIN 关键字在表中存在至少一个匹配时返回行. left join 注释:LEFT JOIN 关键字从左表(table1)返回所有的行,即 ...
- python redis模块详解
前言 现在越来越觉得知识的沉淀尤为重要,最近打算慢慢的把一些知识点做个记录,如果长期不用生疏了也可以快速回顾.下面我会依次介绍在python中常用组件redis,rabbitmq,mongodb,E ...
- Spring @RequestAttribute
@RequestAttribute注解用法 @RequestAttribute用在方法入参上,作用:从request中取对应的值,至于request中是怎么存在该属性的,方式多种多样,拦截器中预存.M ...
- #10 Python字符串
前言 通过上一节可知,Python6个序列的内置类型中,最常见的是列表和元组,但在Python中,最常用的数据类型却不是列表和元组,而是字符串.要想深入了解字符串,必须先掌握字符编码问题.因此本篇博文 ...