Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

ResultSet.getString() on 8000 character CLOB breaks

Nikolay MetchevJan 12 2015 — edited Jan 12 2015

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)

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 9 2015
Added on Jan 12 2015
8 comments
12,189 views