Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

saving a image from database

Status
Not open for further replies.

lowbk

Technical User
Nov 26, 2001
162
SG
hi, i want to retrieve a image that is stored in the database then save it to a file.

the image is stored in a database and i have retrieve it using
select multimedia from table1 where multimediacode=1
then using resultset.getbinarystream("multimedia") and a couple of manipulation with bytearrayoutputstream , i managed to store the multimedia (gif/jpg) into a byte[] (bytearray).

the next step is how to save it to a file?
any kind soul, pls advise
 
FileOutputStream fos = new FileOutputStream("image.gif");
fos.write(byteArray);
fos.close();
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top