I am storing an image in the SQL Server database, but facing a problem in retrieving it back. I am using PreparedStatement and getBinaryStream() method to retrieve an image as InputStream. But after that, I am unable to convert it from the InputStream to a byte array. If anybody know the solution, please letme know....
Thanks, Nidhi
Adeel Ansari
Ranch Hand
Joined: Aug 15, 2004
Posts: 2874
posted
0
It is not a servlet specific question, though. Could you please show up your code?
Chidanand, I have used your code and it's working perfectly. Thanks...
Earlier I was trying to write the bytes to a file...but it was too slow.. but on using imageio as in your code.... it's working quite fast... thanks...
Nidhi
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.
subject: Retrieving an image from SQL Server database