Retrieval of image (Blob) from database - doesn't always work in JSP - Why?
843840Apr 9 2010 — edited Apr 16 2010In my JSP pages, when an image needs to be retrieved, I direct <img src> to a servlet that handles image processing.
As an example, if I have 30 products that need to be shown on 1 webpage, there will be 30, dynamically generated, <img src="go.imageServlet?id=a1"> tags/statements. The servlet, when called, will make a connection to the database, run a query for the image requested (fetched as type Blob), image displays in <img src> area of JSP page, and finally the ResultSet, Statement, and Connection object(s) are closed.
I tested this out, and unfortunately, to my surprise, and disappointment, a few images did not display on the page. Though the images are in the database table. I'm a little lost as to why this problem is occurring.
Can someone please shed some light on this for me?