XML Containing Diacritics Fails With NullPointerException When Queried Using JDBC Against 11.2.0.4 or Higher Database

(Doc ID 1935312.1)

Last updated on JULY 12, 2017

Applies to:

JDBC - Version 11.2.0.2.0 and later
Information in this document applies to any platform.

Symptoms

JDBC Thin driver queries fail against data in XMLTYPE columns when that data contains diacritical marks.
This problem did not manifest until the target database was upgraded from 11.2.0.3 to 11.2.0.4.
The problem does not reproduce when using the JDBC OCI driver, nor when using SQL*Plus.

This problem manifests in one of two ways, depending on the version of the JDBC Thin driver being used:

* The 11.2.0.3 JDBC Thin driver fails with a NullPointerException

* The 11.2.0.4, 12.1.0.1, and 12.1.0.2 Thin drivers fail with java.sql.SQLException: Invalid character encountered in
  at oracle.sql.CharacterSet.failUTFConversion(CharacterSet.java:2940)
  at oracle.sql.CharacterSetAL32UTF8.toString
  (CharacterSetAL32UTF8.java:184)
  at oracle.xdb.XMLType.processString(XMLType.java:3255)
  at oracle.xdb.XMLType.processThin(XMLType.java:3380)
  at oracle.xdb.XMLType.(XMLType.java:1511)
  at oracle.xdb.XMLType.createXML(XMLType.java:957)
  at oracle.xdb.XMLType.createXML(XMLType.java:931)
  at oracle.jdbc.driver.NamedTypeAccessor$XMLFactory.createXML(NamedTypeAccessor.java:118)
  at oracle.jdbc.driver.NamedTypeAccessor.getOracleObject(NamedTypeAccessor.java:249)
  at oracle.jdbc.driver.NamedTypeAccessor.getObject(NamedTypeAccessor.java:136)
  at oracle.jdbc.driver.NamedTypeAccessor.getObject(NamedTypeAccessor.java:110)
  at oracle.jdbc.driver.GeneratedStatement.getObject(GeneratedStatement.java:259)
  at oracle.jdbc.driver.GeneratedScrollableResultSet.getObject(GeneratedScrollableResultSet.java:621)

The problem also reproduces when using the 11.2.0.4 (or 12c) JDBC thin driver against a 12c database.

Changes

 

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms