This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes Challenging Blob read Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Challenging Blob read " Watch "Challenging Blob read " New topic

Challenging Blob read

bindhya prasad

Joined: Jan 29, 2002
Posts: 1
Hi All,
Thanks for your time.
I want to know how to read from the blob and display string.
There is a table Employee (name,id)
name varchar2(32)
id number(10)
There is another table Employee_BLOB with a column emp_blob which is blob.
Now Employee_BLOB table has only one row and one column. In that the blob data
stored is all the records of the Employee table.
This meams if Employee table has 10000 rows. Then the emp_blob column in only one
row has data in the binary format for all the 10000 rows of Employee table.

Now, I can read the blob from the Employee_BLOB table. But how do I get back the
name and id values from it ?
Because of business requirements the datastructure of Employee and Employee_Blob
CANNOT be changes. Also, I can not read from Employee. I have to read from
Employee_Blob and get back all the rows of Employee and store it in JTableModel.
Any help ?
I have something like this to read the blob:
But how do I extract the data from it ?
David O'Meara

Joined: Mar 06, 2001
Posts: 13459

The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at .
We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please re-register and select a new name which meets the requirements.
David O'Meara

Joined: Mar 06, 2001
Posts: 13459

So you say you can read and write the blob, but after reading as a byte array you want to get the data abck?
How is the data stored? Is it a great big String (you can try new String(bytes) ) or is it serialized objects? Something else perhaps?
I agree. Here's the link:
subject: Challenging Blob read
It's not a secret anymore!