aspose file tools*
The moose likes JDBC 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
Bookmark "storing objects in database" Watch "storing objects in database" New topic
Author

storing objects in database

abdonn abdonn
Greenhorn

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: 1081

what kind of objects ???

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

Shailesh


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

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
Marshal

Joined: May 26, 2003
Posts: 30938
    
158

"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.

Thanks,
Jeanne
JDBC Forum Bartender


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30938
    
158

Another alternative to storing the object is to use an O/R (object relational) persistence framework to persist the actual data.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: storing objects in database