How to store and retrieve images from database...

Hi AllAnubody tell me plz how to store images in database using jsp.and how to retrieve tme.Plz reply...Anurag
[145 byte] By [Anurag.Ka] at [2007-10-3 1:58:25]
# 1

Q: What do you store in a database?

A: data

Q: what is an image?

A: data

So I'd say there is absolutely nothing special about storing images. The only thing is that you will want to store two things: the filename and the image data itself. Databases usually have a special data type for storing large amounts of binary data, such as the BLOB. Check your database documentation to figure out what your DBMS uses.

gimbal2a at 2007-7-14 18:57:01 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
hi gimbal2...thanx for reply...can you send me code plz..
Anurag.Ka at 2007-7-14 18:57:01 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
How to retrive different format of images from the database with sample code
appoorvana at 2007-7-14 18:57:01 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
How to retrive different format of images from the database with sample code
appoorvana at 2007-7-14 18:57:01 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5

> So I'd say there is absolutely nothing special about

> storing images. The only thing is that you will want

> to store two things: the filename and the image data

> itself.

And the content type(Jpg, Gif, png ... ect) of the image. Becouse it may be deficult/expensive to figure that out by looking at the image data on the runtime.

LRMKa at 2007-7-14 18:57:01 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 6

Exactly

try the links below may be those might help u in store and retrieval any kind of file.

http://www.mysqltalk.org/insert-blob-example-vt112861.html

https://java.sun.com/j2se/1.5.0/docs/guide/jdbc/blob.html

http://javaalmanac.com/egs/java.sql/GetBlob.html

http://publib.boulder.ibm.com/infocenter/idshelp/v10/index.jsp?topic=/com.ibm.jdbc.doc/jdbc142.htm

and a dearly advice friend please query google b4 you post any query out here.

RahulSharnaa at 2007-7-14 18:57:01 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...