Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ORA-01882: timezone region not found

I'm accessing an Oracle Database from a java application, when I run my application I get the following error:

java.sql.SQLException: ORA-00604: error occurred at recursive SQL level 1 ORA-01882: timezone region not found

like image 459
ndalama Avatar asked Feb 06 '12 06:02

ndalama


2 Answers

You may also try to check the version of the Oracle jdbc driver and Oracle database. Just today I had this issue when using ojdbc6.jar (version 11.2.0.3.0) to connect to an Oracle 9.2.0.4.0 server. Replacing it with ojdbc6.jar version 11.1.0.7.0 solved the issue.

I also managed to make ojdbc6.jar version 11.2.0.3.0 connect without error, by adding oracle.jdbc.timezoneAsRegion=false in file oracle/jdbc/defaultConnectionProperties.properties (inside the jar). Found this solution here (broken link)

Then, one can add -Doracle.jdbc.timezoneAsRegion=false to the command line, or AddVMOption -Doracle.jdbc.timezoneAsRegion=false in config files that use this notation.

You can also do this programmatically, e.g. with System.setProperty.

In some cases you can add the environment variable on a per-connection basis if that's allowed (SQL Developer allows this in the "Advanced" connection properties; I verified it to work when connecting to a database that doesn't have the problem and using a database link to a database which has).

like image 91
Matteo Steccolini Avatar answered Sep 16 '22 15:09

Matteo Steccolini


In a plain a SQL-Developer installation under Windows go to directory

C:\Program Files\sqldeveloper\sqldeveloper\bin 

and add

AddVMOption -Duser.timezone=CET 

to file sqldeveloper.conf.

like image 21
Marcus Rickert Avatar answered Sep 17 '22 15:09

Marcus Rickert