R – Problems with globalization when using Oracle collections with thin JDBC


To summarise the issue:

  1. Retrieving strings in Java 1.5 (JDBC) works fine when the DB encoding is Western ISO 8859-2
  2. When switching to an Eastern European ISO (e.g. ISO 8859-5), all the normal JDBC string conversions work, except the ones involving Oracle collections, e.g. nested tables of objects. Instead of proper strings, even simple ones such as "1", I get "???" (three question marks) instead.

I tried the following JDBC Jar files, but to no avail:

  • ojdbc14.jar
  • orai18n.jar

I also tried both CHAR and VARCHAR2 and both behave the same.

Best Solution

You might want to try using the type NVARCHAR2.

That type is better suited for non-English characters.