I'm working in a new java app that works against a legacy database in db2 that cannot be altered. In one of the tables there is char(32) column that contains comp3 characters.
We read this column using the ibm db2 jdbc type 4 driver. When we examine the bytes to unpack the characters we find that whenever in the bbdd is a byte with the value 25, the jdbc driver recovers it as the value 15. A byte with a value 15 is also recovered as a 15 value, so we have an ambiguous value that we don't know how to solve.
Reading in the ibm documentation it seems that reading strings transforms them from ebcdic to ascii/unicode and this seems to be the root of the problem.
¿ It's there a way to recover the real bytes of the field without this transformation ?
Please note that resultSet.getBinaryStream() isn't working since is a char column and we cannot alter the database in any way. We can only affect to the jdbc connection and the java code.
CASTthe char(32) column to some compatible type to be able to use getBinaryStream(). - Andrew SDECIMALdata type, which in turn should be automatically converted by the JDBC driver tojava.math.BigDecimal-- simply useresultSet.getBigDecimal()- mustaccio