Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
JDBC and Relational Databases
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.
author & internet detective
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.
OCA 8 book
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
What is the best way to store List<List<String>> in database?
WA #1.....word association
How to insert data from file excel into DB?
Problem in exporting data using Displaytag
File name for Excel sheel not showing correctly in Japanese locale
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015