Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Exporting large resultset from Oracle DB to excel  RSS feed

 
Suresh Kumar Sethuramaswamy
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

 
Ivan Jozsef Balazs
Rancher
Posts: 999
5
  • 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!