You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-dev@db.apache.org by Björn Voigt <bv...@hs-harz.de> on 2003/09/22 16:58:49 UTC

problems with storing byte[] to postgres7.3

Howdy ojb developers,

I changed from mapping tool castor to ojb and have some
problems to store byte[] correctly to a my postgres table.

I am using Postgres 7.3 and I want to store images to an
bytea field in my picture table.

First I tried to map the byte[] to BINARY but if I load
the Object from DB I get an byte[] with an bigger length
than the original array back.

In a second test I tried to map the array to BLOB and convert
it in a own FieldConversion to byte[]. But I cant get in the
sqlToJava() the Blob, because there is an Exception in JDBC-Driver before.

I still dont know how, but castor can handle the types without
problems. I wont leave this projekt and change back to castor ;-)


Thank you for any ideas

Björn Voigt



---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org