p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > Java > Java and JDK > JSP Basics
I forgot my password Register Now
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
JSP Basics Beginning-level questions on JSP. More advanced coders should post to Pro JSP.

Welcome to the p2p.wrox.com Forums.

You are currently viewing the JSP Basics section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 27th, 2009, 03:11 AM
Authorized User
Points: 48, Level: 1
Points: 48, Level: 1 Points: 48, Level: 1 Points: 48, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2009
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default displaying images from database(mysqlquerybrowser) in jsp:)

Hello I am Peggie.
Well, I am a newbie in using jsp. I hope that maybe you guys can provide some samples of displaying images from database(mysqlquerybrowser) in jsp page. I also make use of package to call out the connection.

My database in mysql query browser is called: image

And the attribute is
prodID (INT)
ProdImage(blob)

Thanks:)
Hope to receive reply from you guys soon!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old June 29th, 2009, 01:01 AM
Friend of Wrox
Points: 601, Level: 9
Points: 601, Level: 9 Points: 601, Level: 9 Points: 601, Level: 9
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2005
Location: Cochin, Kerala, India.
Posts: 183
Thanks: 4
Thanked 0 Times in 0 Posts
Default

Just google,
you will get many samples. Similar posts are already in this forum.

i think you already know how to connect with mysql
otherwise look,
http://www.roseindia.net/jdbc/jdbc-m...lConnect.shtml

some links for image display,
http://www.theserverside.com/discuss...thread_id=5444
http://fdegrelle.over-blog.com/article-992927-6.html

__________________
jomet.
`````````````````````````````````````````````````` ``````````````````````
Once you start a working on something, dont be afraid of failure and dont abandon it.
People who work sincerely are the happiest.

Last edited by jomet : June 29th, 2009 at 01:07 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #3 (permalink)  
Old June 29th, 2009, 05:27 AM
Authorized User
Points: 48, Level: 1
Points: 48, Level: 1 Points: 48, Level: 1 Points: 48, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2009
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks:)
Oh ya when i try to declare blob at the java page, the 'blob' data type is in error.
Do you guys know how to resolve this?
Thanks:)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #4 (permalink)  
Old June 29th, 2009, 06:36 AM
Friend of Wrox
Points: 601, Level: 9
Points: 601, Level: 9 Points: 601, Level: 9 Points: 601, Level: 9
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2005
Location: Cochin, Kerala, India.
Posts: 183
Thanks: 4
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by Peggie1990 View Post
declare blob at the java page
how you are doing this?
Post the code too..
__________________
jomet.
`````````````````````````````````````````````````` ``````````````````````
Once you start a working on something, dont be afraid of failure and dont abandon it.
People who work sincerely are the happiest.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #5 (permalink)  
Old June 29th, 2009, 06:39 AM
Authorized User
Points: 48, Level: 1
Points: 48, Level: 1 Points: 48, Level: 1 Points: 48, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2009
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Talking

Okay:)
Code:
 
package sg.nyp.edu.sit.model;

public class Image {
int imageID;
Blob image;
public int getImageID() {
return imageID;
}
public void setImageID(int imageID) {
this.imageID = imageID;
}
public Blob getImage() {
return image;
}
public void setImage(Blob image) {
this.image = image;
Code:
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #6 (permalink)  
Old June 29th, 2009, 07:33 AM
Friend of Wrox
Points: 601, Level: 9
Points: 601, Level: 9 Points: 601, Level: 9 Points: 601, Level: 9
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2005
Location: Cochin, Kerala, India.
Posts: 183
Thanks: 4
Thanked 0 Times in 0 Posts
Default

I don't used java.sql.Blob.
My suggestion is to use a byte array for storing binary data like image.

java.sql.Blob provides methods for conversion.
see
http://db.apache.org/derby/docs/10.0...e/sqlj208.html
__________________
jomet.
`````````````````````````````````````````````````` ``````````````````````
Once you start a working on something, dont be afraid of failure and dont abandon it.
People who work sincerely are the happiest.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #7 (permalink)  
Old June 29th, 2009, 07:47 AM
Authorized User
Points: 48, Level: 1
Points: 48, Level: 1 Points: 48, Level: 1 Points: 48, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2009
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks:)

I'll try it:)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

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 2 August 21st, 2008 06:41 PM
displaying images embedded in database jia ASP.NET 1.0 and 1.1 Basics 1 July 5th, 2007 08:06 AM
displaying images in jsp using struts vijayalexander JSP Basics 0 November 6th, 2006 09:46 AM
Displaying Images From Database Metalore BOOK: Beginning ASP.NET 2.0 and Databases 1 November 1st, 2006 11:45 AM
strange problem with displaying LOB images in JSP BuryBear Pro JSP 1 April 23rd, 2006 04:48 AM



All times are GMT -4. The time now is 07:28 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc