Any example out there for storing a java "Properties" object ?

1) What type shall the Table Column have ? BLOB ? CLOB ?

2) Any example of how to do this ?

My assumption until now is that I have to create a BLOB and serialize and
de-serialize the "Properties" object. The latest I found on this was from
Bernt http://www.mail-archive.com/[email protected]/msg06658.html.
So I just need confirmation on the Column type I should choose.

You need to serialize the object. One way of doing it is like this:

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

An vice versa when you retrive the object


B-)

Reply via email to