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
Win a copy of
OCA Java SE 8 Programmer I Study Guide
this week in the
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
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
Jdbc with MS-excel
How 2 Get reports
how to create chart using java api
Exporting from Java to MS Word and MS Excel
Conversion of resultset or collection into sas file format(*.sas7bdat)
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015