aspose file tools*
The moose likes JSP and the fly likes retrieve multiple images from mysql Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "retrieve multiple images from mysql" Watch "retrieve multiple images from mysql" New topic
Author

retrieve multiple images from mysql

shyamkumar bopannachengalaiah
Ranch Hand

Joined: Dec 30, 2008
Posts: 100
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.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61413
    
  67

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
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 agree. Here's the link: http://aspose.com/file-tools
 
subject: retrieve multiple images from mysql