0

java application uses oracle jdbc thin driver.

On server:

NLS_CHARACTERSET = CL8ISO8859P5

NLS_LANGUAGE = AMERICAN

When I execute next query:

INSERT INTO table 
(data)
VALUES
('привет')

the following row is inserted into the table

���вет

What parameters can affect this?

pwflamy
  • 89
  • 2
  • 10
  • 1
    what is your NLS_LANG variable ? – Roberto Hernandez Jul 10 '20 at 09:41
  • from https://stackoverflow.com/a/2585394/13532297 thin jdbc Oracle drivers do not require NLS_LANG or system locale to be specified. But i try to set Locale.setDefault("US") and nothing to change – pwflamy Jul 10 '20 at 10:48
  • How are you querying and displaying the value - also in Java, or in SQL\*Plus or something else? If Java then [see this](https://stackoverflow.com/q/1079985/266304). – Alex Poole Jul 10 '20 at 10:48
  • @pwflamy - why US? Surely you need locale to be set for Russia? – Alex Poole Jul 10 '20 at 10:52
  • @Alex Poole - i used IDEA and Oracle Sql Developer. In IDEA result is ���вет, In Oracle Sql Developer - ☐☐☐☐☐☐. I use US because NLS_LANGUAGE=AMERICAN in nls_database_parameters – pwflamy Jul 10 '20 at 11:16
  • In SQL Developer, go to Tools->Preferences->Environment and check/set Encoding; I guess you need that to be ISO-8859-5, or UTF-8 might be better. I think you need to reconnect and maybe even open a new worksheet to see the difference - I'd be tempted to quite and relaunch to make sure. – Alex Poole Jul 10 '20 at 11:27
  • @AlexPoole i try to set ISO8859_5 and UTF-8. Relaunch SQL Developer after each change encoding. The result has not changed in both cases - ☐☐☐☐☐☐ – pwflamy Jul 10 '20 at 11:52

0 Answers0