This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
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

Win a copy of REST with Spring (video course) this week in the Spring forum!
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: 32819

"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: 32819

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
jQuery in Action, 3rd edition