aspose file tools*
The moose likes Java in General and the fly likes String to Object conversion & vice-versa Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "String to Object conversion & vice-versa" Watch "String to Object conversion & vice-versa" New topic

String to Object conversion & vice-versa

Jugnu Gupta

Joined: Jul 12, 2004
Posts: 3
I want to convert an object into string to store it in databse as varchar. Also when I retrieve this string from database, I should be able to get the same object i.e string to object conversion should be possible. Has anyone done this? Please share your ideas....

Thanks in advance.
Petr Blahos
Ranch Hand

Joined: Apr 28, 2004
Posts: 131
How about serializing the Object in a String?


Get a better web browser:<br /><a href="" target="_blank" rel="nofollow"></a>
Tony Morris
Ranch Hand

Joined: Sep 24, 2003
Posts: 1608
Serialize the object to a blob (java.sql.Blob) or use an O-R Mapping tool such as Hibernate.

Tony Morris
Java Q&A (FAQ, Trivia)
Jugnu Gupta

Joined: Jul 12, 2004
Posts: 3
example, if I have to convert an array of Integer to string....The ava data types implement i should be able to do it.How?
I agree. Here's the link:
subject: String to Object conversion & vice-versa
Similar Threads
String and StringBuffer
String literal comparisons - help!
Forbidden Conversions
Simple question on SelectOneRadio
convert String into Object