File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Download microsoft office document from DB Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Download microsoft office document from DB" Watch "Download microsoft office document from DB" New topic
Author

Download microsoft office document from DB

Chandra Mohan
Ranch Hand

Joined: Oct 06, 2003
Posts: 62
Hi

I would like to download the microsoft office document (may be doc or docx or xls) from the database. I have to download almost 4000 files based SQL condition. I would like to know the best way (interms of good performances) to download the files from SQL Server.

Let me know if additional info has needed..

Regards
Mohan


Thanks and Regards
Chandra Mohan
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18135
    
    8

Stream the data directly from the database to wherever you want to put it. ResultSet has a getBinaryStream() method which returns an InputStream so just read from that and write to some suitable OutputStream.
Chandra Mohan
Ranch Hand

Joined: Oct 06, 2003
Posts: 62
Paul Clapham wrote:Stream the data directly from the database to wherever you want to put it. ResultSet has a getBinaryStream() method which returns an InputStream so just read from that and write to some suitable OutputStream.



Thanks.. The files are downloading really fast.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Download microsoft office document from DB
 
Similar Threads
downloading attachments with javamail
Writing to a Microsoft Word Document using Java
upload in jsp
how to retrieve images on a jsp page
save url as mht or pdf