Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Download microsoft office document from DB

 
Chandra Mohan
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Paul Clapham
Sheriff
Posts: 21416
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic