File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Java SE 8 for the Really Impatient
this week in the
Exporting ResultSet data to MS Excel
Joined: Jan 11, 2008
Jan 11, 2008 11:45:00
I want to write a List into an
file. The List is essentially retrieved from a MySQL DB. Is there a code that can be used to achieve this? Please help...
Joined: Oct 13, 2005
Jan 11, 2008 15:35:00
Welcome to the Ranch.
Sorry that nobody has replied earlier. Don't know about direct input to Excel, but it is quite easy to change the output to comma separated format; Excel opens csv files by default.
Joined: May 26, 2003
Jan 11, 2008 17:39:00
Welcome to JavaRanch!
If you just need a file that opens in Excel, I second the CSV format. If you need to have Excel formatting, you can use an Excel library. The open source
is a good one.
You still have to loop through the result set and output the results in CSV/HSSF. You could do generically in one place for your app though.
How To Ask Questions The Smart Way
Blogging on Certs:
SCEA Part 1
Part 2 & 3
Core Spring 3
TOGAF part 1
I agree. Here's the link:
subject: Exporting ResultSet data to MS Excel
How to insert data from file excel into DB?
File name for Excel sheel not showing correctly in Japanese locale
What is the best way to store List<List<String>> in database?
Problem in exporting data using Displaytag
WA #1.....word association
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014