|
|
 |
| 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.
|
 |

June 27th, 2009, 03:11 AM
|
|
Authorized User
|
|
Join Date: Jan 2009
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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!
|

June 29th, 2009, 05:27 AM
|
|
Authorized User
|
|
Join Date: Jan 2009
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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:) 
|

June 29th, 2009, 06:36 AM
|
|
Friend of Wrox
|
|
Join Date: Aug 2005
Location: Cochin, Kerala, India.
Posts: 183
Thanks: 4
Thanked 0 Times in 0 Posts
|
|
Quote:
Originally Posted by Peggie1990
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.
|

June 29th, 2009, 06:39 AM
|
|
Authorized User
|
|
Join Date: Jan 2009
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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;
|

June 29th, 2009, 07:33 AM
|
|
Friend of Wrox
|
|
Join Date: Aug 2005
Location: Cochin, Kerala, India.
Posts: 183
Thanks: 4
Thanked 0 Times in 0 Posts
|
|
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.
|

June 29th, 2009, 07:47 AM
|
|
Authorized User
|
|
Join Date: Jan 2009
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thanks:)
I'll try it:)
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |