JDBC之ResultSet

JDBC之ResultSet

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()) {…}
 
JDBC之ResultSet
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:
 
JDBC之ResultSet
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:
 
JDBC之ResultSet
The last thing I think that our attention should be paid to is that the lifecycle of the ResultSet
 
JDBC之ResultSet

转载于:https://www.cnblogs.com/immortal-worm/p/5375424.html

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/109078.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • SpringCloud与Dubbo区别[通俗易懂]

    SpringCloud与Dubbo区别[通俗易懂]SpringCloud和Dubbo都是当下流行的RPC框架,各自都集成了服务发现和治理组件。SpringCloud用Eureka,Dubbo用Zookeeper,这篇博客就将将这两个组件在各自系统中的作用机制的区别。1.注册的服务的区别Dubbo是基于java接口及Hession2序列化的来实现传输的,Provider对外暴露接口,Consumer根据接口的规则调用。也就是Provider向Zookeeper注册的是接口信息,Consumer从Zookeeper发现的是接口的信息,通过接口的name

    2022年5月25日
    45
  • C++ 数值与 string 的相互转换

    C++ 数值与 string 的相互转换使用函数模板将基本数据类型(整型、字符型、实型、布尔型)转换成string。//ostringstream对象用来进行格式化的输出,常用于将各种类型转换为string类型//ostringstream只支持<<操作符template<typenameT>stringtoString(constT&t){ostringstreamoss;//创建一个格式化输出流

    2022年5月14日
    35
  • filetype all java试卷_java认证考试试题及答案

    filetype all java试卷_java认证考试试题及答案java认证考试试题及答案故答案为C。12.Whatistheresultafterthefollowingcodeexecutes?1shorts=0x00FD;2byteb=(byte)s;3System.out.println(b);Select1correctanswer:A.Compiletimeerrorinline1B.Comp…

    2022年7月8日
    25
  • 大数据中数据采集的几种方式

    大数据中数据采集的几种方式一、采集大数据的方法1.1通过系统日志采集大数据用于系统日志采集的工具,目前使用最广泛的有:Hadoop的Chukwa、ApacheFlumeAFacebook的Scribe和LinkedIn的Kafka等。这里主要学习Flume。Flume是一个高可靠的分布式采集、聚合和传输系统,Flume支持在日志系统中定制各类数据发送方,用于收集数据,同时对数据进行简单处理,并写到诸如文本、HDFS…

    2022年5月20日
    70
  • centos7安装图形界面

    centos7安装图形界面Centos7安装图形界面第一步:确认yum可用1.1判断yum是否可用,输入yumlist如果出现以下信息,则代表不可用。1.2更改配置vi/etc/sysconfig/network-scripts/ifcfg-ens33进入到是这样的更改最后一行的数据1.3重启网络…

    2022年4月29日
    36
  • NoSQL数据库介绍

    NoSQL在2010年风生水起,大大小小的Web站点在追求高性能高可靠性方面,不由自主都选择了NoSQL技术作为优先考虑的方面。今年伊始,InfoQ中文站有幸邀请到凤凰网的孙立先生,为大家分享他之于N

    2021年12月26日
    57

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号