|Subject||Re: [Firebird-Java] reading binary data (CHARACTER SET OCTETS)|
> Hi,This is correct, since they are interpreted according to the connection
> I have problem with reading binary data defined as CHAR(n) CHARACTER SET
> OCTETS using JayBird (1.5.x, 2.x).
> The values are returned as String, so non-ascii characters are
encoding (and if none is specified, it uses default encoding for JVM).
> I think that correct type of binary data should be byte.Depends. The CHAR/VARCHAR columns according to the JDBC specification are
by default mapped to String. That means that ResultSet.getObject(int) will
return you an instance of java.lang.String class. However, nobody prevents
you from using ResultSet.getBytes(int) method and you will get the raw
> I'm using JayBird through 3rd party Java application KettleVARBINARY is not VARCHAR CHARACTER SET OCTESTS. And unfortunately Firebird
> (kettle.javaforge.com) which supports JDBC connections. With MySQL JDBC
> driver I have no problem, VARBINARY(n) column type is readed as byte.
does not support VARBINARY type...
> The second question is: is there any way to read data defined as CHAR(n)Use the ResultSet.getBytes(int) method and ensure that you do not specify
> CHARACTER SET NONE as binary data? I don't want JayBird or JVM to make
> any character conversions when reading/writting data.
connection charSet or encoding.