File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes storing objects in database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "storing objects in database" Watch "storing objects in database" New topic

storing objects in database

abdonn abdonn

Joined: Apr 27, 2005
Posts: 1
how can i save a whole object in database(oracle 10)? please help!
Shailesh Chandra
Ranch Hand

Joined: Aug 13, 2004
Posts: 1082

what kind of objects ???

you can use PreparedStatement.setBlob() to store , about blob there are plenty of examples available on ent


Gravitation cannot be held responsible for people falling in love ~ Albert Einstein
S Herod

Joined: Apr 25, 2005
Posts: 10
Can i ask why do you want to do this?

As far as I know, serialising objects into a database will cause you issues, esp if your class changes. You won't be able to retrieve serialised objects which use older definitions of the class.
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33111

"abdonn abdonn",
Welcome to JavaRanch!

We're pleased to have you here with us in the JDBC forum, but there are a few rules that need to be followed, and one is that proper names are required. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

JDBC Forum Bartender

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33111

Another alternative to storing the object is to use an O/R (object relational) persistence framework to persist the actual data.
I agree. Here's the link:
subject: storing objects in database
It's not a secret anymore!