SQL CHAR type using setByte() - Mailing list pgsql-jdbc

From David Wall
Subject SQL CHAR type using setByte()
Date
Msg-id 006701c0ac08$bfdb25a0$5a2b7ad8@expertrade.com
Whole thread Raw
List pgsql-jdbc
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 and then the first byte from the string was stored in the database.  I'm using 7.1.1beta4.
 
Does this make any sense?  Am I using the wrong SQL type or the wrong JDBC PreparedStatement set call?
 
Thanks,
David

pgsql-jdbc by date:

Previous
From: "David Wall"
Date:
Subject: Re: serialized objects and JDBC driver
Next
From: "David Wall"
Date:
Subject: Re: SQL CHAR type using setByte()