Win a copy of Java EE 8 High Performance this week in the Java/Jakarta EE forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

problems in fetching photo from Database  RSS feed

Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends,

I am storing some photos in MySQL database, and fetching them using a servlet, the problem is that I have list of photos in a JSP page, and whenever I referh the page the photos got mixed up and appear randomly, sometimes one of the photos appear instead of 3 photos, and sometimes 1 photo appear istead of 2 photos. I put the anti-caching script in the JSP list page, however still the same.

for example, the below jsp excerpt is correct HTML, however, it don't show the right photos :

<td><img src="/irtiadAlafaqAdmin/;jsessionid=325C3BD9FEBA53F47F4DAC66E9F12AAA?seriesID=1"></td>
<td><img src="/irtiadAlafaqAdmin/;jsessionid=325C3BD9FEBA53F47F4DAC66E9F12AAA?seriesID=2"></td>
<td><img src="/irtiadAlafaqAdmin/;jsessionid=325C3BD9FEBA53F47F4DAC66E9F12AAA?seriesID=3"></td>

the servlet is as below:

prep=myConnection.prepareStatement("SELECT sloganBinaryData,sloganContentType FROM series WHERE seriesID='"+form1.get("seriesID")+"' ");
OutputStream output=response.getOutputStream();

return null;

Awaiting for your respionse,

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!