Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General 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
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Limiting ResultSet

 
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I have more than 10 lakh records in database.

i need to fire a query to the database and
generate the xml by putting those data got form query.

Now what i wrote the program, throws heap memory error.

Now what i want to limit the size of result set.
like take only 50 lakh result in resultset, generate xml, then
go for next 50 lackh data in result set, generate xml and so on....

Is this possible?

Or any other but better way to do it?

Thanks,
Kaya.
 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try using scrollable resultset
 
kayanaat sidiqui
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Adinath
Thank you for quick reply.
can you please tell me how to use scrollable resultset for my scenerio.

waiting for your prompt and sharp comment.

Thanks
 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

Already discussed , see this topic
https://coderanch.com/t/446842/JDBC/java/limit-result-through-JDBC
 
You can thank my dental hygienist for my untimely aliveness. So tiny:
ScroogeXHTML 9.0 - RTF to HTML5 and XHTML converter
https://coderanch.com/t/731949/ScroogeXHTML-RTF-HTML-XHTML-converter
    Bookmark Topic Watch Topic
  • New Topic