aspose file tools*
The moose likes JDBC and the fly likes problem in storing an object to the database! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "problem in storing an object to the database!" Watch "problem in storing an object to the database!" New topic
Author

problem in storing an object to the database!

yuvaraj KumarAmudhan
Ranch Hand

Joined: Aug 22, 2009
Posts: 110
this question may be silly but i have to ask. Can i store a java object into the database?
For example, An object of class 'Object' can be stored?

thanks if you answer me smoothly.
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30965
    
158

You can store a Serializable object in a BLOB.


[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
yuvaraj KumarAmudhan
Ranch Hand

Joined: Aug 22, 2009
Posts: 110
in what manner the objects stored and retrieved by java? How can i retrieve an object from the database? with mehtods like getObject and getBlob?


thanks
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30965
    
158

yuvaraj yuvan wrote:in what manner the objects stored and retrieved by java? How can i retrieve an object from the database? with mehtods like getObject and getBlob?


thanks

See the Serialization tutorial. You get a binary stream and then unserialize it into an Object.
John de Michele
Rancher

Joined: Mar 09, 2009
Posts: 600
yuvaraj:

You may want to look into Hibernate, or another ORM platform.

John.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem in storing an object to the database!