• 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
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Exporting large resultset from Oracle DB to excel

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All,

I have a requirement to export large data approx 1 million records into an excel using java .

I used POI and it works fine upto 150 thousands and throws "JAva heap space error" when the record count is more.

I followed an option of Rownum , but performance wise that is bad since everytime it hits DB and rownum evaluates only afer the entire resultant rows are fetched.

Can someone help me how can i achive this ?
or is there any other suggested approach to export the data from DB in any other forms like pdf or something?

Regards,
rockssk

 
Rancher
Posts: 1039
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you use an object in memory representing the whole document, you naturally run the danger of memory exhaustion.

There is an xml-based spreadsheet format. You can generate a huge document using this format without having to store the whole document in memory.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!