Search code examples
javaoraclenls-lang

How set NLS_LANG for every connection (ojdbc8)


I using java application and using ojdbc8 to connecting to DB and I have a legacy database set with NLS_LANG set to CL8ISO8859P5. This I cannot change.

And i got problem, when i sending data to DB, it`s replacing unknow characters like « and » to ?

How i can change NLS_LANG for all connections in app or fix this problome on other way?


Solution

  • « and » do not exit in ISO 8859-5 (aka. CL8ISO8859P5). If you cannot change the characters set then there is no solution.

    Either do not use « and » or try NCHAR/NVARCHAR2 data type, which typically supports a wider set of characters.