When I execute a query using PreparedStatement.executeQuery()
from a Java application I get a resultSet
object with wrong values for some of the fields. When I use PLSQL developer then the value looks ok.
The field value is 10101010
but in the resultSet it's 1$ffssff
. The database field size is only 8 bytes but the result value I get is 9 bytes (and totally wrong). The type for this field is VARCHAR2(8 BYTE)
This only happens sometimes. Other times when I execute the same query I get the correct value.
How is it possible that resultSet fetches the wrong value for some of the fields ? Are there some settings I need to verify for this? My NLS_RDBMS_VERSION
is 11.2.0.3.0
.
Do you think it's a Java side problem or Oracle side data fetching problem?
Please let me know if you need additional details.