Re: [JDBC] Using char fields with 7.1.3 driver

2001-09-06 Thread David Wall
I'm not a JDBC expert, but this is pretty much the way I'd expect it to work. If you a have fixed length field, then the field should return that many characters. The varchar implies it's variable length, so trailing spaces would then not be included. David ---(end of

Re: [JDBC] Re: Unable to store SHA hash (Non-HTML--Sorry)

2001-05-03 Thread David Wall
In my code where I need to store short pieces of binary data (like digests) I encode them in hex and store the hex. Yes this results in a 2 times increase in storage, and some overhead in encoding/decodeing, but it isn't too bad. Sure you could use other encodings for the binary data, but

Re: [JDBC] serialized objects and JDBC driver

2001-03-13 Thread David Wall
ByteArrayInputStream bis = new ByteArrayInputStream(data); ObjectInputStream p = new ObjectInputStream(bis); EncryptionInfo ei = (EncryptionInfo)p.readObject(); Are you using setBytes/getBytes in JDBC? That's worked for me when the SQL type is OID on 7.1beta4. David

[JDBC] SQL CHAR type using setByte()

2001-03-13 Thread David Wall
I have a Java byte field that I'm trying to store in the database. It has a value of (byte)'0' which is a binary 48. When I use preparedStatement.setByte() with that value, to store in a Postgresql CHAR field, it only stores a '4'. It's as if the binary 48 were being converted to a String