How to store a bitmap or jpeg file on oracle database?which datatype is used and what is the retrival method ?

Questions by ashish_bharatkar

Showing Answers 1 - 5 of 5 Answers

Aditya

  • May 22nd, 2006
 

Using 'lob' or 'blob' image files or any kind of files that are huge in size can be stored

sudheer

  • Oct 6th, 2006
 

To store larger object in database use 'blob'

  Was this answer useful?  Yes

You can store a jpeg file or a bitmap file in Oracle using the BLOB data type.
It stores the jpeg image as a stream of bytes.
In order to retrieve the data.
You cant simply perform a select query over it.
From the client side you need to Access the particular field you want to.
First execute a select query over the data.
the resultset. or recordset. will not be directly accesible.
Then take a byte field equivalent data type. in your program.
in Java it will be something like this.

byte data[]=new data[<size of the data>];
data=rs.getBytes(<field name>);

Now you can convert the data into an image as per the class you want to use.
One such class is Image in Java.
Thank You.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions