Newbie's questions

Z

Zalek Bloom

Hi,
I want to write a Java sevlets with MySQL database that will show
different pictures.
Question nr 1:
if is more efficient to store pictures on MySQL, or to store pictures
in some directory and to keep on MySQL just names of pictures?

Question nr 2.
I have on MySQL a picture. My servlet must create a HTML page with
this picture. How I can do this? What HTML tags I need to show a
picture from MySQL?

Thanks,

Zalek
 
K

Ken Ream

Zalek Bloom said:
Hi,
I want to write a Java sevlets with MySQL database that will show
different pictures.
Question nr 1:
if is more efficient to store pictures on MySQL, or to store pictures
in some directory and to keep on MySQL just names of pictures?

Generally, its not going to be more efficient to take the extra step of
retrieving the image from a databse, but if there are good business reasons
to do it (security, customer customization,etc.) then do it.
Question nr 2.
I have on MySQL a picture. My servlet must create a HTML page with
this picture. How I can do this? What HTML tags I need to show a
picture from MySQL?

You'll want an <IMG> tag - find an HTML tutorial online for an example.
One hint - one attribute of the IMG tag is the source of the image. If its
in
a directory no problem. If you store the image in your database, then write
a servlet to retieve ther image and put the URL of the image servlet as the
source attribute for your IMG tag.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top