In fact, we work in a strong typed environment.
All the data is passed from a client to the server thru "bastypes" (typed objects).
The only way to get the data contained in it is to get some kind of representation wich is a
string.
What i do is :
gets the string from the basetype
gets the bytes from that string
insert a record in the db using the empty_blob() function
"select ... for update" the created record
get the blob object from the resultset
create a byteinputstream with the byte[] from the string
get an outputstream on the blob
push the bytes in the blob (intream/outstream)
close the streams
commit
those base types are available on the server and on the client.
On the client, if I get the data in a basetype (open file) and then write the content of the bastype on disk under a different name, both files are strictly the same.
Regarding the database, the db is accessed by an application written in PB too and the import of documents in the blob column works fine.
I suspect the
JDBC layer to use some king of locale or charset defined somewhere and to make conversion on the string part not on he bytes ...