• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to store a table's data from oracle database into an excel file?

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am doing a small application using JSP, Servlets, Oracle DataBase express edition.
In this, I store some data into a particular table of the database from the application. The user of the application wants the data from that table to have it stored in an excel file.
To be specific, I have to provide an option for the user to delete a particular "vehicle" under operation from the application after its agreement expires. But the user wants all the data in an excel file.
How do I do it?
 
Bartender
Posts: 2661
19
Netbeans IDE C++ Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Some applications solve this by pushing a .csv file to the user.
This extension is usualy associated with Excel (if they have MSOffice installed).

Another solution is to build real Excel files. You could use Apache POI.

The POI project consists of APIs for manipulating various file formats based upon Microsoft's OLE 2 Compound Document format using pure Java. In short, you can read and write MS Excel files using Java.

Regards, Jan
 
Jan Cumps
Bartender
Posts: 2661
19
Netbeans IDE C++ Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And (works in my setup XP with Excel 2003):
Create a file with extension .xls, and write the contents as tab delimited values. It opens in excel as if it was a real excel document.
 
Nikhil Reddy Lingala
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I understood that I should use Apache POI API for my application in order to convert database tables to excel.
Do I need to do any pre-configuration for that? like writing an xml file... or any such kind of stuff??
and one more thing.. how do I get the javadocs download for Apache POI?
 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The Displaytag library (http://displaytag.sourceforge.net) has options to output to Excel.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic