ojdbc14.jar与ojdbc6.jar [英] ojdbc14.jar vs. ojdbc6.jar

查看:1297
本文介绍了ojdbc14.jar与ojdbc6.jar的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到以下差异,但没有在任何地方看到它记录。我想知道其他人是否注意到了同样的事情,或者可以指出一些证明相同的文件。

I noticed the following difference but did not see it documented anywhere. I'm wondering if others have noticed the same thing or can point me to some documentations that proves the same.

环境: -

Oracle 11g,JDK 1.6,iBatis,PL / SQL

情景: -

ojdbc14.jar :如果pl / sql返回类型 DATE 的变量,我尝试将其放在java.sql.Date变量中,那么一切正常。示例:

ojdbc14.jar: if pl/sql returns a variable of type DATE and I try to put that in a java.sql.Date variable then everything works fine. Example:

日期年度日=(日期)map.get(exam_date);

ojdbc6.jar :如果pl / sql返回类型 DATE 的变量,我试着把它放在java.sql.Date变量中,我得到一个异常:

ojdbc6.jar: if pl/sql returns a variable of type DATE and I try to put that in a java.sql.Date variable then I get an exception:

java.lang.ClassCastException: java.sql.Timestamp cannot be cast to java.sql.Date


推荐答案

实际上, ojdbc14.jar 并没有真正说明驱动程序的真实版本(参见 JDBC驱动程序下载),除了它早于Oracle 11g。在这种情况下,你应该提供确切的版本。

Actually, ojdbc14.jar doesn't really say anything about the real version of the driver (see JDBC Driver Downloads), except that it predates Oracle 11g. In such situation, you should provide the exact version.

无论如何,我想你会在 DATE和TIMESTAMP是怎么回事?简而言之,他们改变了9.2驱动程序和然后再次在11.1司机。

Anyway, I think you'll find some explanation in What is going on with DATE and TIMESTAMP? In short, they changed the behavior in 9.2 drivers and then again in 11.1 drivers.

这可能解释了您遇到的差异(我建议使用最新版本,即11.2驱动程序)。

This might explain the differences you're experiencing (and I suggest using the most recent version i.e. the 11.2 drivers).

这篇关于ojdbc14.jar与ojdbc6.jar的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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