oracle - ORA-01882: timezone region not found

oracle – ORA-01882: timezone region not found

oracle – ORA-01882: timezone region not found

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.

n

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)

n

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.

n

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

n

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

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

n

C:\Program Files\sqldeveloper\sqldeveloper\binn

n

and add

n

AddVMOption -Duser.timezone=CETn

n

to file sqldeveloper.conf.

oracle – ORA-01882: timezone region not found

Error I got :

n

Error from db_connection.java –>> java.sql.SQLException: ORA-00604: error occurred at recursive SQL level 1n ORA-01882: timezone region not found

n

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

n

Prev code:

n

 public Connection getOracle() throws Exception {n     Connection conn = null;n     Class.forName(oracle.jdbc.driver.OracleDriver);n     conn = DriverManager.getConnection(jdbc:oracle:thin:@127.0.0.1:1521:tap, username, pw);n     return conn;n}n

n

new Code:

n

 public Connection getOracle() throws Exception {n     TimeZone timeZone = TimeZone.getTimeZone(Asia/Kolkata);n     TimeZone.setDefault(timeZone);n     Connection conn = null;n     Class.forName(oracle.jdbc.driver.OracleDriver);n     conn = DriverManager.getConnection(jdbc:oracle:thin:@127.0.0.1:1521:tap, username, pw);n     return conn;n}n

n

now it is working!!

Related posts on Oracle :

Leave a Reply

Your email address will not be published.