Java 我们可以将 ojdbc14.jar 与 Oracel11g 和 jdk1.5 一起使用吗

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4369660/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-14 16:37:56  来源:igfitidea点击:

Can we use ojdbc14.jar with Oracel11g and jdk1.5

javajdbcoracle11g

提问by Fazal

I believe there are different flavors of this questions already asked, but I wanted to confirm this again as we are very close to our release and wanted to validate with the community

我相信已经提出了不同的问题,但我想再次确认这一点,因为我们非常接近我们的发布并希望与社区进行验证

We have been using Oracle10g and java 1.5 for quite some time now with ojdbc14.jar. I know that ojbc14.jar is catered towards java 1.4. But thankfully we never saw any issue while using this with 1.5 version. Another reason for not moving to ojbc5 was the fact that we did not see ojdbc5.jar in the installed oracle 10g at all.

我们已经使用 Oracle10g 和 java 1.5 和 ojdbc14.jar 已经有一段时间了。我知道 ojbc14.jar 是针对 java 1.4 的。但幸运的是,我们在 1.5 版本中使用它时从未发现任何问题。不迁移到 ojbc5 的另一个原因是我们在安装的 oracle 10g 中根本没有看到 ojdbc5.jar。

We have upgraded our DB to be 11g now and I did not see ojdbc14.jar. Does this mean we have to move to ojdbc5.jar?

我们现在已经将我们的数据库升级到 11g,但我没有看到 ojdbc14.jar。这是否意味着我们必须移动到 ojdbc5.jar?

We are willing to make the change. But can the people who made the switch confirm if they saw any issue when they changed the JDBC driver to ojdbc5.jar from ojdbc14.jar

我们愿意做出改变。但是进行切换的人能否确认他们在将 JDBC 驱动程序从 ojdbc14.jar 更改为 ojdbc5.jar 时是否看到任何问题

Related to it, it would be good if someone can elaborate little more about dms flavors of this jar and how it is to be used.

与此相关,如果有人能详细说明这个 jar 的 dms 口味以及如何使用它,那就太好了。

采纳答案by skaffman

ojbc14should work just fine with Oracle11g. The primary differences between ojbc14and later versions is the later version support newer versions of the JDBC API, as well as new features of the newer versions of oracle.

ojbc14使用 Oracle11g 应该可以正常工作。ojbc14和更高版本之间的主要区别是更高版本支持新版本的JDBC API,以及新版本oracle 的新特性。

If your application gets along with ojbc14as it is, there's little reason to upgrade the driver, other than the fact that it's always a good idea to try and track new revisions as they come along, to keep your system current.

如果您的应用程序ojbc14按原样运行,则几乎没有理由升级驱动程序,除了尝试跟踪出现的新修订始终是一个好主意,以保持您的系统最新。

回答by darioo

Take a look at Oracle's JDBC drivers list. For 11g and 11g2, only ojdbc5.jarand ojdbc6.jarare listed. This could mean that only they are officially supported, so if you have problems with ojdbc14.jar, Oracle probably won't help you.

查看Oracle 的 JDBC 驱动程序列表。对于11g和11g2,只有ojdbc5.jarojdbc6.jar被列出。这可能意味着只有它们得到官方支持,因此如果您在使用 时遇到问题ojdbc14.jar,Oracle 可能不会帮助您。

If Oracle's support is important for your management, I'd recommend upgrading to ojdbc5.jar.

如果 Oracle 的支持对您的管理很重要,我建议升级到ojdbc5.jar.

回答by Raja

Below are the suggestions from Oracle:

以下是Oracle建议

the 11.1 drivers by default convert SQL DATE to Timestamp when reading from the database. This always was the right thing to do and the change in 9i was a mistake. The 11.1 drivers have reverted to the correct behavior. Even if you didn't set V8Compatible in your application you shouldn't see any difference in behavior in most cases. You may notice a difference if you use getObject to read a DATE column. The result will be a Timestamp rather than a Date. Since Timestamp is a subclass of Date this generally isn't a problem. Where you might notice a difference is if you relied on the conversion from DATE to Date to truncate the time component or if you do toString on the value. Otherwise the change should be transparent.

If for some reason your app is very sensitive to this change and you simply must have the 9i-10g behavior, there is a connection property you can set. Set mapDateToTimestamp to false and the driver will revert to the default 9i-10g behavior and map DATE to Date.

从数据库读取时,11.1 驱动程序默认将 SQL DATE 转换为 Timestamp。这始终是正确的做法,而 9i 中的更改是一个错误。11.1 驱动程序已恢复到正确的行为。即使您没有在应用程序中设置 V8Compatible,在大多数情况下您也不应该看到任何行为差异。如果您使用 getObject 读取 DATE 列,您可能会注意到不同。结果将是时间戳而不是日期。由于 Timestamp 是 Date 的子类,因此这通常不是问题。您可能会注意到不同之处在于,您是否依赖从 DATE 到 Date 的转换来截断时间组件,或者您是否对值执行 toString 操作。否则,更改应该是透明的。

如果出于某种原因,您的应用程序对这种更改非常敏感,并且您必须具有 9i-10g 行为,那么您可以设置一个连接属性。将 mapDateToTimestamp 设置为 false,驱动程序将恢复到默认的 9i-10g 行为并将 DATE 映射到 Date。