Hi, I'm saving image files (bmp, jpg, gif) in the database as binary data (I'm using SQL Server). Then, I have to retrieve this file and show the image in a JSP. I'm using Struts 1.1, SQLServer and weblogic. How can I do this? Thanks
I would suggest first to get a connection to the database and in someway to get a Collection of 'binary data images'; then, applying the same pattern used to convert images from their format to binary format, but on the way back, use the <html:image> Struts tag to display it on your page. My 2 cents.
I was looking for a good solution to the same problem a couple of months back. This solution may not be the best, but It was the only one I could find at the time - performance was ok using MySQL but awful on DB2 - you'll have to see for yourself. Anyway, I used a helper servlet to get the binary data from the DB - here's the code...