Using Oracle 10g and ojdbc14.jar thin driver, but it has occured in Oralce 9, as well as using classes12.jar driver.
The data in the DB is CHAR(1) and is storing "Y" or "N"
The result is registered as oracle.jdbc.OracleTypes.CHAR, but I have also tried VARCHAR and java.sql.Types.CHAR and VARCHAR
For some reason, when I do statement.getString(#) for that item, it return a String with length 32512 instead of 1. I can do charAt(0) or trim() to get the right value.
It works perfectly fine if the data is defined as VARCHAR2(1) in the database instead of CHAR(1).
When am in SQLPlus, it returns it properly, so it must be JDBC related. It looks almost like a lack of null termination for the string.
Has anyone came across this before or have a solution?
The data in the DB is CHAR(1) and is storing "Y" or "N"
The result is registered as oracle.jdbc.OracleTypes.CHAR, but I have also tried VARCHAR and java.sql.Types.CHAR and VARCHAR
For some reason, when I do statement.getString(#) for that item, it return a String with length 32512 instead of 1. I can do charAt(0) or trim() to get the right value.
It works perfectly fine if the data is defined as VARCHAR2(1) in the database instead of CHAR(1).
When am in SQLPlus, it returns it properly, so it must be JDBC related. It looks almost like a lack of null termination for the string.
Has anyone came across this before or have a solution?