Link to home
Start Free TrialLog in
Avatar of mfeldmei
mfeldmei

asked on

Writing a complex object to DB2

I am trying to write a complex Java object to a DB2 (v5) LONG VARHCAR AS BIT DATA column.  This object consists of various other objects, which contain other objects, etc.

Doing this to a file is a one-line ordeal.  I can't seem to find anything similar to serialize this to the database.

Any ideas of how I can just take this object and persist it (maybe using PreparedStatement.setObject()) with a minimum of changes to the object?

Thanks!
ASKER CERTIFIED SOLUTION
Avatar of heyhey_
heyhey_

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mfeldmei
mfeldmei

ASKER

Replacing oos.write(yourObject) with oos.writeObject(yourObject) works beautiful!  Thanks heyhey_!
Thanks for the points :)