Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ResultSet to MS-Excel.

 
Srinivasa Raghavan
Ranch Hand
Posts: 1228
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a table in the DB with more than 75,000 records.
Is it possible to write first 30,000 records in one Excel work sheet & next 30000 records in the next worksheet and so on till we reach the end of record.
[ October 17, 2004: Message edited by: srini vasan ]
 
Ajith Anand
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sure....

You may have two approaches to the problem.
1. This is a generic approach and which would work across all databases. This is explained below please refer the code snippet




2. You may also do this by applying row-limit-constraints on the query itself....
eg in oracle you may want to say

you may want to do this incase you want a multithreaded approach to filecreation
 
Srinivasa Raghavan
Ranch Hand
Posts: 1228
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ajith,
I cant get you ..Logic for spliting the records into 30000 is fine
but what i need is ...
if i set the Mime Type to Excel.. it will write in only one sheet ..

Srini
[ October 17, 2004: Message edited by: srini vasan ]
 
Srinivasa Raghavan
Ranch Hand
Posts: 1228
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I hope POI can solve this problem ..
But where cani find the jar's necessary for POI.
Is it free download ?
 
Ajith Anand
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Srini,

it is a free download....you will find some of these samples relevant...
excel worksheets
 
Srinivasa Raghavan
Ranch Hand
Posts: 1228
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ajith And Ajith And:
Hi Srini,

it is a free download....you will find some of these samples relevant...
excel worksheets


But where can we find the relevant jars.

Srini
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving this to JDBC, it doesn't appeat to be Servlet specific.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic