ORA-01882: 未找到时区 [英] ORA-01882: timezone region not found

查看:71
本文介绍了ORA-01882: 未找到时区的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在从 Java 应用程序访问 Oracle 数据库,当我运行我的应用程序时出现以下错误:

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: 递归 SQL 级别 1 发生错误ORA-01882: 未找到时区

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

推荐答案

您也可以尝试检查Oracle jdbc驱动和Oracle数据库的版本.就在今天,我在使用 ojdbc6.jar(版本 11.2.0.3.0)连接到 Oracle 9.2.0.4.0 服务器时遇到了这个问题.将其替换为 ojdbc6.jar 版本 11.1.0.7.0 解决了该问题.

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.

我还设法通过在文件 oracle/jdbc/defaultConnectionProperties.properties 中添加 oracle.jdbc.timezoneAsRegion=false 使 ojdbc6.jar 版本 11.2.0.3.0 正确连接(在 jar 中).在这里找到了这个解决方案(链接失效)

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)

然后,可以将 -Doracle.jdbc.timezoneAsRegion=false 添加到命令行,或 AddVMOption -Doracle.jdbc.timezoneAsRegion=false 在使用的​​配置文件中这个符号.

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.

您也可以通过编程方式执行此操作,例如与 System.setProperty.

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

在某些情况下,如果允许,您可以在每个连接的基础上添加环境变量(SQL Developer 在高级"连接属性中允许这样做;我验证了它在连接到没有问题并使用数据库链接到具有的数据库).

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).

这篇关于ORA-01882: 未找到时区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆