Want to display jpg image in my JSP from oracle DB.
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   G_K
Posted On:   Sunday, March 19, 2006 10:16 AM


How to insert blob(to store my jpg) field directly in oracle using INSERT statement?



how to retrieve that above JPG from oracle to display on the JSP using ByteArrayInputStream.


let me know please

Re: Want to display jpg image in my JSP from oracle DB.

Posted By:   WarnerJan_Veldhuis  
Posted On:   Sunday, March 19, 2006 04:27 PM

First of all, a blob in Oracle points to somthing internal, so an insert statement looks like this:
);
INSERT INTO myTable (someBlobField) values( empty_blob() )

After that, you can get the record, and get the BinaryInputstream and start the binary stream to the server.... Example is here: http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:238014476571



Getting the jpg from the server is a question of creating a servlet that handles the requests for images:



All the servlet needs to do is to get the blob, and stream it to the OutputStream of the servlet, mime-type "image/jpeg"
About | Sitemap | Contact