Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

How ResultSet works

 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic