• 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
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

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.
 
Talk sense to a fool and he calls you foolish. -Euripides A foolish tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic