Home > Database > Mysql Tutorial > body text

What methods does ResultSet provide for browsing it in JDBC?

王林
Release: 2023-08-28 21:29:02
forward
891 people have browsed it

ResultSet 提供了哪些方法来在 JDBC 中浏览它?

We have two types of ResultSet objects namely forward only and bidirectional, as the name suggests in forward only ResultSet you can move only in one direction (forward) whereas in In a bidirectional ResultSet you can move the pointer in both directions. The ResultSet interface provides multiple methods for browsing both types of ResultSet objects.

The following table lists the various methods for browsing ResultSet objects.

This method moves the result set pointer forward one row. This method moves the result set pointer backward one row. This method moves the result set pointer to the first row. last()This method moves the result set pointer to the last row. This method accepts an integer value representing the number of rows and advances the result set pointer or moves a given number of rows backward (positive integers move forward, negative integers move backward). This method accepts a row of integer values ​​representing numbers and moves the result set pointer to The given position in the result set (based on 1). tr>This method moves the result set pointer to its default position, which is before first. This method positions the result set pointer after the last row.
Method Description
##next()

Previous()

first()

relative()

absolute() If a positive integer is passed to the result set, the pointer will be moved to the given position starting from the first row of the result set.

If a negative integer is passed to the result set, the pointer will be moved to the given position starting from the last one in the result set.

beforeFirst()

afterLast()

The above is the detailed content of What methods does ResultSet provide for browsing it in JDBC?. For more information, please follow other related articles on the PHP Chinese website!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!