Hello,
We have encountered a very strange bug. If you have a CLOB column in an Oracle and you store an 8000 character string in there then when reading it using oracle jdbc driver
using ResultSet.getString() something goes wrong with the encoding. The string appears to be interleaved with the char '\0'. If the CLOB stores 4000 characters or 8001 characters the bug doesn't reproduce.
This only happens for us when running on linux (Centos 7) with both Oracle Java 7 and Oracle Java 8 and using either ojdbc7 or ojdbc6.
When running in Windows this bug doesn't happen. Charset.defaultCharset() returns UTF-8 on both windows and Linux.
Also if we revert to using the oracle 11.2.0.4 jdbc driver this bug doesn't reproduce either.
versions:
Database:
Oracle Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP, Data Mining
and Real Application Testing options
JDBC
(Oracle JDBC driver 12.1.0.2.0)