Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9012911
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T03:07:11+00:00 2026-06-16T03:07:11+00:00

Suppose to have a ResultSet rs with n object. This code: while(rs.next()) { //

  • 0

Suppose to have a ResultSet rs with n object.

This code:

while(rs.next()) {
   // do something on rs
}

is algoritmically equal to this code (i.e. both gave the same result):

for(i=1; i<=n; i++) {
   rs.absolute(i)
   // do something on rs
}

But are this equivalant on terms of throughouts? Is the first faster? Or, for a given i, rs.next() is just a wrapper for rs.absolute(i+1)?

Best regards
MC

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T03:07:12+00:00Added an answer on June 16, 2026 at 3:07 am

    rs.next demands a simpler kind of database cursor (FORWARD_ONLY) than rs.absolute so in most cases you will degrade performance/resource efficiency with rs.absolute. In certain cases, where there is no optimization for a FORWARD_ONLY cursor anyway, you may get the same performance.

    Some drivers may allow absolute calls even with FORWARD_ONLY, validating that the requested record is the next one, but again others may throw an exception regardless.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Suppose I have a static method of my class that returns an object of
I have the following php object(??? new to this). It is being sent through
Suppose I have, class example(object) def __init__(var1 = 10, var2 = 15, var3 =
Consider two lines from code: ... rs.next(); //rs is ResultSet interface. rs.getString(name); ... Byte
Hi Suppose I have a simple model class like this: class TestModel(models.Model): testkey =
Suppose we have the following code. I want to swap out the inner parse_place
Suppose I have the following results: a=FindInstance[2*b^2 + b^3 == b^4 + t &&
suppose i have a .on() function wherein i select multiple ids $(#i, #am, #your,
Suppose I have a large list of words. For an example: >>> with open('/usr/share/dict/words')
Suppose I have a pure virtual method in the base interface that returns to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.