Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Retrieval of image (Blob) from database - doesn't always work in JSP - Why?

843840Apr 9 2010 — edited Apr 16 2010
In 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?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 14 2010
Added on Apr 9 2010
10 comments
331 views