This week's book giveaway is in the Open Source forum.
We're giving away four copies of RabbitMQ in Depth and have Gavin Roy on-line!
See this thread for details.
The moose likes JDBC and Relational Databases 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 RabbitMQ in Depth this week in the Open Source forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
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: 186
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: 3740

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.

[OCA 8 Book] [Blog]
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: 186
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