0

While trying to connect to db2, using ojdbc8, I am getting an error:

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

at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:509) at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:456) at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:451) at oracle.jdbc.driver.T4CTTIfun.processError(T4CTTIfun.java:1040) at oracle.jdbc.driver.T4CTTIoauthenticate.processError(T4CTTIoauthenticate.java:552) at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:550) at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:268) at oracle.jdbc.driver.T4CTTIoauthenticate.doOAUTH(T4CTTIoauthenticate.java:501) at oracle.jdbc.driver.T4CTTIoauthenticate.doOAUTH(T4CTTIoauthenticate.java:1292) at oracle.jdbc.driver.T4CTTIoauthenticate.doOAUTH(T4CTTIoauthenticate.java:1025) at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:743) at oracle.jdbc.driver.PhysicalConnection.connect(PhysicalConnection.java:793) at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:57) at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:747) at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:562) at java.sql.DriverManager.getConnection(DriverManager.java:664) at java.sql.DriverManager.getConnection(DriverManager.java:247) at com.Learnjdbc.Connect.getConnection(Connect.java:33)

As per the line in logs, I am getting error on below line

conn = DriverManager.getConnection(URL,username,password);

Code snippet:

       try {
                Class.forName(className);
                conn = DriverManager.getConnection(URL,username,password);
            } catch (SQLException e) {
                e.printStackTrace();
            } catch (ClassNotFoundException e) {
                e.printStackTrace();
            }

There is one way mentioned in ORA-01882: timezone region not found but this talks about changes in JAR, while I am using maven repo to get packages.

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
R_S_C
  • 75
  • 1
  • 10
  • What's the version of database? – Suresh Apr 09 '21 at 09:59
  • 2
    Attempting to connect to DB2 using the Oracle JDBC driver makes no sense at all. DB2 is an entirely different product than Oracle. Given the error, I'm assuming you're actually connecting to Oracle, and have removed the db2 tag. Please provide a [mre], including your exact server version, driver version and connection URL. (and no, ojdbc8 is not a version number, it just means the driver is for Java 8). – Mark Rotteveel Apr 09 '21 at 10:00
  • 1
    What is your time zone? You may set it with Environment variable like this: `JAVA_TOOL_OPTIONS=-Duser.timezone=Europe/Zurich` – Wernfried Domscheit Apr 09 '21 at 10:08
  • Check this [post](https://stackoverflow.com/questions/28452513/how-to-set-the-timezone-region-for-jdbc-connection-and-avoid-the-sqlexception-ti). – Suresh Apr 09 '21 at 10:37

0 Answers0