Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to store java objects in the database

843854Feb 12 2002 — edited Feb 12 2002
Hi,

I am trying to store HttpSession state across Application Servers. Basically I am trying to build a sort of application cluster server on my own. I thought the best way to do this was to periodically store the HttpSession object from an application server in a database.

I created a table in Oracle 8i with a blob column. I use a PreparedStatement.setObject() method to store the HttpSession object in the database. My problem is, I don't know how to get the object back from the database.

Since ResultSet.getBlob returns the Blob locator, I need to read the BinaryInputStream to get all my data back. This tells me that getBlob basically works only for things like files, and cannot be used for Java objects.

Is there any way around this? Your input would be much appreciated.

Regards,
Somaiah.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 12 2002
Added on Feb 12 2002
2 comments
125 views