ResultSet is a interface
More gnerally,ResultSet is a class involves a table returned by executeQuery cluase from jdbc,which includes the whole information we wanna get from our query,however if we want to retrive these info in java applet ,jdbc provides us a cursor.Let's see how Java API explain it
After reading this explanation , we can understand the meaning of whlie (rs.next()) {...}
 
In the while loop,we use cursor to access each row,but here comes the problem:how could we convert the underlying data in the set pointed by cursor to Java type?Here are the explanation from Java API:
 
We must provide a parameter to getter methods we invoke,which stands for the column that we wanna get information from.As for the parameter,API also give us some details about it.Let's take a look at it:
 
The last thing I think that our attention should be paid to is that the lifecycle of the ResultSet
 

JDBC之ResultSet的更多相关文章

  1. MySQL数据库学习笔记(九)----JDBC的ResultSet接口(查询操作)、PreparedStatement接口重构增删改查(含SQL注入的解释)

    [声明] 欢迎转载,但请保留文章原始出处→_→ 生命壹号:http://www.cnblogs.com/smyhvae/ 文章来源:http://www.cnblogs.com/smyhvae/p/4 ...

  2. JDBC用ResultSet访问大量数据时会遇到的问题

    我们经常需要JDBC来对数据库就行操作,一般流程为连接数据库.通过sql语句把需要的数据取出来保存到ResultSet,然后调用ResultSet方法的类似 getString,getInt()等方法 ...

  3. JDBC的ResultSet游标转spark的DataFrame,数据类型的映射以TeraData数据库为例

    1.编写给ResultSet添加spark的schema成员及DF(DataFrame)成员 /* spark.sc对象因为是全局的,没有导入,需自行定义 teradata的字段类型转换成spark的 ...

  4. 获取jdbc中resultSet结果集的大小

    当我们执行完一条Sql语句,获取到一个 ResultSet 对象后,有时我们需要立即知道到底返回了多少个元素,但是 ResultSet 并没有提供一个 size() 方法 or length 的属性, ...

  5. 将JDBC的resultSet映射到JavaBaen

    // 执行赋值后SQL,            rs=pstm.executeQuery();            //判断是否有返回结果,有下一行rs.next()方法为true          ...

  6. JDBC 学习笔记(八)—— ResultSet

    JDBC 使用 ResultSet 来封装 SQL 的查询结果,可以将 ResultSet 类比为数据库表的查询结果. 它拥有如下两个性质: 可滚动. 可更新. 这两个性质,是在创建 Statemen ...

  7. JDBC题库

    一.    填空题 JDBC    ,是一种用于执行SQL语句的Java API,为多种关系数据库提供统一访问.它由一组用Java语言编写的类和接口组成. JDBC API:供程序员调用的接口与类,集 ...

  8. JDBC接口规范

    前言 JDBC(JavaDatabase Connectivity)表示Java查询引擎连接,由一组用Java编程语言编写的类和接口组成.JDBC为Java程序访问关系型查询引擎提供了编程接口,为查询 ...

  9. JDBC常见面试题

    以下我是归纳的JDBC知识点图: 图上的知识点都可以在我其他的文章内找到相应内容. JDBC常见面试题 JDBC操作数据库的步骤 ? JDBC操作数据库的步骤 ? 注册数据库驱动. 建立数据库连接. ...

随机推荐

  1. [每日一题] 11gOCP 1z0-052 :2013-09-2 ADDM(Automatic Database Diagnostic Monitor)...................A28

    转载请注明出处:http://blog.csdn.net/guoyjoe/article/details/10951207 正确答案:BC AWR简称Automatic Workload Reposi ...

  2. Chapter 1. Introduction gradle介绍

      We would like to introduce Gradle to you, a build system that we think is a quantum leap for build ...

  3. LSI SAS 2208 配置操作

    配置LSISAS2208 介绍LSISAS2208扣卡的配置方法. 2.1 登录CU界面 介绍登录LSISAS2208的CU配置界面的方法,以及CU界面的主要功能. 2.2 创建RAID 介绍创建RA ...

  4. Sorting File Contents and Output with sort

     Sorting File Contents and Output with sort   Another very useful command to use on text file is  so ...

  5. 配置Windows下编译运行C/C++过程

    1.首先确定电脑安装了VS或者VC++的IDE: 2.修改环境变量 在系统属性-高级-环境变量-用户变量中: 编辑PATH增加cl编译器的路径D:\Program Files\Microsoft Vi ...

  6. TreeView绑定无限层级关系类

    protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Bind_TV(TreeView1.Nodes); ...

  7. uploadify在asp.net中的试用小结

    花了差不多一下午的时间,总算把uploadify插件运行起来,在此对自己遇到的问题以及过程做一个小结. 一.使用步骤 1.在官网下载最新的插件包,并将包解压. 2.新建asp.net web项目,将解 ...

  8. js添加onclick函数

    document.getElementById('Add').setAttribute("onclick",AddNum()); 相当于不停的调用Addnum函数 应改成docum ...

  9. Date与Calendar

    Date date=new Date();//现在时间 Date date1=new Date(1000);//格林威治时间1997/01/01开始算,后面的是毫秒 Calendar calendar ...

  10. CRT内存调试标记

    static unsigned char _bNoMansLandFill = 0xFD; /* fill no-man's land with this */ static unsigned cha ...