• 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: 21975
36
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.
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!