Putting serializable classes in SQL?
Here's the situation. I have a bunch of objects that implement Serializable
that I want to store in a SQL database. I have two questions.
- Is there a way to serialize the object directly to the database
- Is this the best way to do it or should I
- Enter the object into formatting
String
and put it in the database that way and then parse it back - Write to each member in the database a field that is unique for each object
- Enter the object into formatting
+2
a source to share
3 answers
It is generally not a good idea to try and put some kind of object (serialized / delimited) in your SQL because changing it is always a bitch.
Sounds like you are on the right track with Idea 2. Is this a one-to-many situation? (because then xref would obviously be the correct answer) or even a foreign key would be better. amuses.
+1
a source to share