java之java.sql.SQLException: ResultSet is from UPDATE. No Data.
问题解释:java调用存储过程的时候,查询结果不能通过ResultSet来查询,需要通过CallableStatement来查询,
比如:
ResultSet rs = callableStatement.executeQuery();
while(rs.next()){
int empno = rs.getInt(1);
String empname = rs.getString(2);
System.out.println(empno);
System.out.println(empname);
} //这种查询方式错误,报java.sql.SQLException: ResultSet is from UPDATE. No Data. 应该通过下面的方式:
int empno = callableStatement.getInt(1);
String empname = callableStatement.getString(2);
System.out.println(empno);
System.out.println(empname);
java之java.sql.SQLException: ResultSet is from UPDATE. No Data.的更多相关文章
- Caused by: java.sql.SQLException: ResultSet is from UPDATE. No Data.
1.错误描述 org.hibernate.exception.GenericJDBCException: error executing work at org.hibernate.exception ...
- javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: ResultSet is from UPDATE. No Data.
Java jpa调用存储过程,抛出异常如下: javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCEx ...
- resultset 对象获取行字段数据时报:java.sql.SQLException: Column 'id' not found.
resultset 对象获取行字段数据时报:java.sql.SQLException: Column 'id' not found. 代码: String sql="SELECT d.co ...
- java.sql.SQLException: Operation not allowed after ResultSet closed
转自:http://blog.csdn.net/hellobobantang/article/details/7173622 java.sql.SQLException: Operation not ...
- Oracle java.sql.SQLException: 数字溢出
六月 30, 2016 5:47:47 下午 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinit ...
- mybatis oracle java.sql.SQLException: 流已被关闭问题
/** * 按照页码取值(从current_page页开始,每页page_size条) * @param key * @param params * @param current_page * @pa ...
- java.sql.SQLException: 对只转发结果集的无效操作: last
出错代码如下:static String u = "user";static String p = "psw";static String url = &quo ...
- java.sql.SQLException: Before start of result set
在使用JDBC查询数据库报了这么一个错误 CREATE TABLE `d_user` ( `id` int(10) NOT NULL, `name` varchar(10) DEFAULT NULL, ...
- java.sql.SQLException: Before start of result set解决方法
java.sql.SQLException: Before start of result set解决方法 今天做东西的时候发现这个错误,查了查,特地记下来,以后开始积累了 哈哈 解决发法是: 使用r ...
随机推荐
- 2016/4/1 jquery 与javascript关系 ①取元素 ②操作内容 ③操作属性 ④操作 样式 ⑤ 事件 点击变色
jQuery的min版本和原版功能是一样的,min版主要应用于已经开发成的网页中,而非min版 的文件比较大,里面有整洁的代码书写规范和注释,主要应用于脚本开发过程当中. JQuery是继protot ...
- 将最大主机/ DNS名称字符长度从63增加到255
https://mp.weixin.qq.com/s/WcjaAgAOvEhjtP2nXx5Fhw Zabbix 4.0.0alpha8发行说明 运维帮 昨天 Zabbix团队很高兴地宣布Zabbix ...
- Spring Security调研记录【七】--核心模型与实现
网上有非常多关于Spring Security文章中,都觉得Spring Security(相对于shiro)过于复杂,个人觉得复杂的是Spring Security的官方文档而不是Spring Se ...
- Windows7 配置匿名Samba文件共享
1.环境 系统:Windows 7 SP1 IP:192.168.118.151 2.配置 计算机|管理|本地用户和组|用户|Guest-->去掉账户已禁用 cmd|gpedit.msc|本地计 ...
- HDU1698 Just a Hook —— 线段树 区间染色
题目链接:https://vjudge.net/problem/HDU-1698 In the game of DotA, Pudge’s meat hook is actually the most ...
- java 泛型的理解与应用
为什么使用泛型? 举个例子: public class GenericTest { public static void main(String[] args) { List list = new A ...
- Macaca框架
收藏 http://www.cnblogs.com/jinjiangongzuoshi/p/6537795.html
- Java-Runoob-高级教程-实例-字符串:10. Java 实例 - 测试两个字符串区域是否相等-uncheck
ylbtech-Java-Runoob-高级教程-实例-字符串:10. Java 实例 - 测试两个字符串区域是否相等 1.返回顶部 1. Java 实例 - 测试两个字符串区域是否相等 Java ...
- sql server 日期模糊查询
转换成varchar类型 ) like '%2010-10-09%' 两个字段拼接成一个字段 SELECT C0252_ID, C0252_name,C0252_Addr, ((select top ...
- git根据commit生成patch(转载)
转自:http://smilejay.com/2012/08/generate-a-patch-from-a-commit/ 在看一个Bugzilla上Xen的一个bug时,提到要revert掉Dom ...