问题解释: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.的更多相关文章

  1. Caused by: java.sql.SQLException: ResultSet is from UPDATE. No Data.

    1.错误描述 org.hibernate.exception.GenericJDBCException: error executing work at org.hibernate.exception ...

  2. javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: ResultSet is from UPDATE. No Data.

    Java jpa调用存储过程,抛出异常如下: javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCEx ...

  3. resultset 对象获取行字段数据时报:java.sql.SQLException: Column 'id' not found.

    resultset 对象获取行字段数据时报:java.sql.SQLException: Column 'id' not found. 代码: String sql="SELECT d.co ...

  4. java.sql.SQLException: Operation not allowed after ResultSet closed

    转自:http://blog.csdn.net/hellobobantang/article/details/7173622 java.sql.SQLException: Operation not ...

  5. Oracle java.sql.SQLException: 数字溢出

    六月 30, 2016 5:47:47 下午 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinit ...

  6. mybatis oracle java.sql.SQLException: 流已被关闭问题

    /** * 按照页码取值(从current_page页开始,每页page_size条) * @param key * @param params * @param current_page * @pa ...

  7. java.sql.SQLException: 对只转发结果集的无效操作: last

    出错代码如下:static String u = "user";static String p = "psw";static String url = &quo ...

  8. java.sql.SQLException: Before start of result set

    在使用JDBC查询数据库报了这么一个错误 CREATE TABLE `d_user` ( `id` int(10) NOT NULL, `name` varchar(10) DEFAULT NULL, ...

  9. java.sql.SQLException: Before start of result set解决方法

    java.sql.SQLException: Before start of result set解决方法 今天做东西的时候发现这个错误,查了查,特地记下来,以后开始积累了 哈哈 解决发法是: 使用r ...

随机推荐

  1. 本人会linux系统的各种版本的安装,近期发教程

    小弟虽然刚刚踏入职场,可是咱大学也不是打酱油过的啊,研究过各种版本系统的安装,也都均已经实践,勿喷,有问题 咱们可以相互探讨!

  2. setTimeout不可靠的修正办法及clearTimeout

    javascript里的这两个定时器函数,大家一定耳熟能详: setTimeout("函数()",毫秒)就是开启一个计时器,指定毫秒后执行该函数一次. 有关定时器,javascri ...

  3. mysql 5.5安装不对容易出现问题

    按照正常步骤安装完了mysql 5.5之后,再运行一下bin目录中的mysqlinstanceconfig.exe,重置一下密码!!!! 重置密码的地方:modify security setting ...

  4. Ubuntu 12.10终端Terminal快捷方式调用

    1:使用快捷键:ctrl+alt+t 打开终端 2:在终端上右键,选“Lock to launcher” 这样就锁定在左侧了,需要用时,直接点就打开了.

  5. HDU1160 FatMouse's Speed —— DP

    题目链接:http://acm.split.hdu.edu.cn/showproblem.php?pid=1160 FatMouse's Speed Time Limit: 2000/1000 MS ...

  6. Ural 2003: Simple Magic(数论&思维)

    Do you think that magic is simple? That some hand-waving and muttering incomprehensible blubber is e ...

  7. python名片管理系统

    1.代码: (1)主程序 #!/usr/bin/env python # -*- coding: UTF-8 -*- import cards_tools # 无限循环,由用户主动决定什么时候退出循环 ...

  8. 【转】jenkins上配置robotframeworkride自动化脚本任务

    jenkins上配置robotframeworkride自动化脚本任务 编写好的自动化脚本,集成在jenkins上进行自动运行于监控,这里采用分布式构建,在一台slave上进行任务构建与自动化脚本的运 ...

  9. 分布式缓存一致性hash算法

    当服务器不多,并且不考虑扩容的时候,可直接使用简单的路由算法,用服务器数除缓存数据KEY的hash值,余数作为服务器下标即可. 但是当业务发展,网站缓存服务需要扩容时就会出现问题,比如3台缓存服务器要 ...

  10. 520. Detect Capital(检测数组的大小写)

    Given a word, you need to judge whether the usage of capitals in it is right or not. We define the u ...