• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

retrieve multiple images from mysql

 
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic