db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bernt M. Johnsen" <bernt.john...@sun.com>
Subject Re: Insert JAVA_OBJECT in embedded Derby DB
Date Fri, 04 May 2007 10:53:19 GMT
You need to serialize the object. One way of doing it is like this:

        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        ObjectOutputStream oos = new ObjectOutputStream(bos);
        ps.setBytes(1, bos.toByteArray());

An vice versa when you retrive the object :-)

Bernt Marius Johnsen, Database Technology Group, 
Staff Engineer, Technical Lead Derby/Java DB
Sun Microsystems, Trondheim, Norway

View raw message