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 ...
随机推荐
- 从PRISM开始学WPF(一)WPF?
从PRISM开始学WPF(一)WPF? 我最近打算学习WPF ,在寻找MVVM框架的时候发现了PRISM,在此之前还从一些博客上了解了其他的MVVM框架,比如浅谈WPF中的MVVM框架--MVVM ...
- Exception from container-launch: org.apache.hadoop.util.Shell$ExitCodeException
使用MapReduce编写的中文分词程序出现了 Exception from container-launch: org.apache.hadoop.util.Shell$ExitCodeExcept ...
- 自定义的强大的UITableViewCell
UITableView的强大更多程度上来自于可以任意自定义UITableViewCell单元格.通常,UITableView中的Cell是动态的,在使用过程中,会创建一个Cell池,根据每个cell的 ...
- AngularJS自己定义标签加入回调函数eval()
function helloworld(name){ console.log("hello!!!!!"+name) } var name="zhangsan"; ...
- STL vector的介绍(1)
尝试下翻译STL里面的一些easy和算法.四级过了.六级刚考.顺便练练自己的英语水平.翻译的不好的地方请大神多多不吝赐教哈.方便我改正. 原来均来自:http://www.cplusplus.com/ ...
- js简易美丽的提示框
<span style="font-size:14px;">function showTips(txt, time, status) { var htmlCon = ' ...
- 【iOS9系列】- CoreSportlight内容索引的使用
[iOS9系列]- CoreSportlight内容索引的使用 前言 在iOS9中新增加了的CoreSportlight内容索引,这个还是比较实用的,当我们的App比较多的时候,我们会实用iOS系统的 ...
- Response.ContentLength获取文件大小
Response.ContentLength返回的是请求内容的大小,而不是请求文件的大小,当我们用Http断点续传的时候,比如文件大小为100M,第一次下载的时候ContentLength的大小就是1 ...
- RJ45接口定义及网线线序
RJ45接口定义 常见的RJ45接口有两类:用于以太网网卡.路由器以太网接口等的DTE类型,还有用于交换机等的DCE类型. DTE我们可以称做“数据终端设备”,DCE我们可以称做“数据通信设备”.从某 ...
- beyond compare 比较文本 standard alignment VS unaligned
在Rules里面 Standard Alignment 这种方式会比较找出相同的部分,可能会跨行找相同的 Unaligned 这种比较直接每一行之间相互比较,不跨行找相同的