K
K
KuchinRussia2016-02-25 11:13:48
Java
KuchinRussia, 2016-02-25 11:13:48

How to defeat all the same encoding in JDBC (Oracle)?

There is a Java SE application, developed on a Win-machine in Eclipse. The application communicates with the Oracle 11.2 database via JDBC (thin), fetches Cyrillic data and processes it. Based on WIN1251 encoding. For JDBC, the ojdbc6.jar and orai18n.jar libraries are imported (the latter solves problems with encoding in complex objects and collections).

Everything works correctly on this development machine. Nowhere in the code are encodings explicitly specified, everything is converted and read correctly anyway.

I put the received application on the fight. I collect Runnable JAR, I do Extract of all libraries in it. I upload the resulting JAR and configs to the combat server (OpenSuse 12). I rolled up a fresh JDK for the battle (everything was compiled for the 8th version). I launch it in battle - the application reads the Cyrillic alphabet from the database with question marks.

Where to dig?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
KuchinRussia, 2016-02-25
@KuchinRussia

It was necessary to dig in the direction that the whole thing is being launched from under the crown, and the environment variables are not set.

export LC_ALL=ru_RU.UTF-8
export NLS_LANG=AMERICAN_AMERICA.CL8MSWIN1251
export LANG=ru_RU.UTF-8

cured all problems.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question