Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Java and JDK > Servlets
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Servlets section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 9th, 2009, 06:10 PM
Authorized User
 
Join Date: Jan 2009
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default Displaying images dynamically from database:)

Hey guys do you have any samples that can display images dynamically from database(sql query browser) and display it on jsp and servlets?
The attribute for my image is called: image(varchar)
Thanks:)


Thanks:D
Reply With Quote
  #2 (permalink)  
Old July 9th, 2009, 09:11 PM
Friend of Wrox
 
Join Date: Jun 2008
Location: Snohomish, WA, USA
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

Ummm...varchar????

What kind of database allows images to be stored in a VARCHAR field???

You sure you aren't just storing the PATH to the image in that field, with the image actually in a disk file referenced by that path??

If you really have an image stored *IN* the database, it should almost surely be stored in a BLOB or BIT VARYING or similar field type. But, again, it depends on which DB your are using.
Reply With Quote
  #3 (permalink)  
Old July 10th, 2009, 12:53 AM
Authorized User
 
Join Date: Jan 2009
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ops sorry I made a mistake. Yeap it is the path for the image insetad of the original image itself. In eclipse web content I create a folder named images and it the folder there is Beanie image category whereby the image.jpg is encode in it.

Below is the code that I used to display out the images.
Code:
 
<td> <div style=""><img border="1" src="images/Beanie/<%=rs.getString("Image") %>" height="160" width="160" /></div>
</td>


Do you guys know how to display all the 100 images from the database dynamically?
Thanks:D

The software that I am using is called eclipse, tomcat6 and sql query browser.:D
Reply With Quote
  #4 (permalink)  
Old July 10th, 2009, 03:38 PM
Friend of Wrox
 
Join Date: Jun 2008
Location: Snohomish, WA, USA
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

I've never heard of "sql query browser" as the name of a database. But I think that's unimportant.

All you need to do is use the right SQL query and the loop through all the records.

Show the code you have in that page with the rs.getString( ). Where is the SQL it is using? Where is rs created? etc., etc.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Storing images in Database and displaying them Manoj Bisht ASP.NET 1.x and 2.0 Application Design 4 February 6th, 2010 03:06 AM
displaying images from database(mysqlquerybrowser) in jsp:) Peggie1990 JSP Basics 6 June 29th, 2009 06:47 AM
displaying images embedded in database jia ASP.NET 1.0 and 1.1 Basics 1 July 5th, 2007 07:06 AM
Displaying Images From Database Metalore BOOK: Beginning ASP.NET 2.0 and Databases 1 November 1st, 2006 11:45 AM
Displaying images from database in Crystal Report gp_mk Crystal Reports 7 September 7th, 2004 11:54 PM



All times are GMT -4. The time now is 04:44 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.