• Post Reply Bookmark Topic Watch Topic
  • New Topic

Help......Writer BLOB from DB to File.....

 
sam patel
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have blob field in SQLServer and i would like to write that blob to a file.
Any help or suggestions will be greatly appreciated.
Thanks
 
Greg T Robertson
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Basically you can get a Blob (see java.sql.Blob) from the result set. Read the InputStream given by getBinaryStream and write it to an OutputStream in a while loop reading XXXX and then writing XXXX. That's the way I've done in the past on other DBs. This if of course assumes that SQLServer JDBC implementation correctly implements Blob (and I believe it does).
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!