aspose file tools*
The moose likes JDBC and the fly likes Export Query to Excel for ORACLE Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Export Query to Excel for ORACLE" Watch "Export Query to Excel for ORACLE" New topic

Export Query to Excel for ORACLE

sudha swami
Ranch Hand

Joined: Apr 24, 2007
Posts: 179
I would like to Export the result of sql query into Excel.
[ September 18, 2007: Message edited by: sudha swami ]
Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3697

A lot of GUI applications will allow you to cut and paste data into Excel but from a programmatic standpoint, its best to write a java program that converts the result set into a CSV file (just fields separated by commas) and import that into excel.

You could also try GUI tools for exporting your database directly into a CSV file.

My Blog: Down Home Country Coding with Scott Selikoff
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
See if the POI Library does what you need. I've only used it to read excel but it worked easily enough.

A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
sudha swami
Ranch Hand

Joined: Apr 24, 2007
Posts: 179
Thanks alot for the info. Currently i am using GUI Tool, DBVisualizer and it supports exporting the data into CSV
I agree. Here's the link:
subject: Export Query to Excel for ORACLE
Similar Threads
Upload Excel Data in oracle Database
JasperReports -- excel issue
Export to excel
how to export data to Excel
Export functionality