• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Jj Roberts
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Himai Minh
  • Carey Brown
  • salvin francis

retrieve multiple images from mysql

 
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i need to display a set of images randomly by retreiving the images from database.I need code for it .I have to display in particular table in my webapplication.
 
Marshal
Posts: 67478
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JavaRanch is not the place to come and get others to write your code for you. You will get lots of help with your code, but you have to put in the work. Please read this for more information.

Basically, you need to put tags on your pages that reference resources (servlets perhaps, but not JSPs) that will serve the image data.
 
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

shyamkumar bopannachengalaiah wrote:i need to display a set of images randomly by retreiving the images from database.I need code for it .I have to display in particular table in my webapplication.


JSP outputs HTML.
In HTML, images are represented by the <img> tag.
In <img>, the 'src' attribute should point to a valid URL of an image stream.
A valid URL of an image stream can be either a static image, or a dynamic image.
A dynamic image can be served by a servlet which takes a parameter representing the image ID, reads the image from the DB as an InputStream and writes it to the OutputStream of the response.

If you need public code, just Google the smart way. "ImageServlet" or so.
 
I'm doing laundry! Look how clean this tiny ad is:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic