• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

How ResultSet works

 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I know that the implementation of ResultSet and all the JDBC API is provided by the vendor specific drivers For ex: classes12.jar

Consider the senario where the select statement returns 1 million rows how it will handled by the ResultSet...

Wrushasen D
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As you mentioned, the implementation of ResultSet is vendor specific, but I don't believe there's a simgle implementation that will retrieve all million rows and try to store them in memory. The ResultSet will fetch a number of rows at a time, and as the client code iterates through the rows, it will keep fetching more rows as needed.

That's why it's so important to remember that a ResultSet object is only valid while the connection to the database is still live. The ResultSet itself may not contain all the data. It's merely a proxy that communicates with the database to retrieve data as needed.
 
Tomorrow is the first day of the new metric calendar. Comfort me tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic