This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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
internet detective
Marshal

Joined: May 26, 2003
Posts: 30057
    
149

"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
internet detective
Marshal

Joined: May 26, 2003
Posts: 30057
    
149

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
 
Similar Threads
Tech Word Game
Shopping Cart - Part 2
share data
Sharing data between web app's
Large Files