Home >Database >Mysql Tutorial >What methods does ResultSet provide for browsing it in JDBC?

What methods does ResultSet provide for browsing it in JDBC?

王林
王林forward
2023-08-28 21:29:02924browse

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!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete