使用oracle.jdbc.OracleDriver

官方解释:

Package oracle.jdbc Description
Beginning in Oracle9i, the Oracle extensions to JDBC are captured in the package oracle.jdbc. This package contains classes and interfaces that specify the Oracle extensions in a manner similar to the way the classes and interfaces in java.sql specify the public JDBC API.
Your code should use the package oracle.jdbc instead of the package oracle.jdbc.driver used in earlier versions of Oracle. Use of the package oracle.jdbc.driver is now deprecated, but will continue to be supported for backwards compatibility.
All that is required to covert your code is to replace "oracle.jdbc.driver" with "oracle.jdbc" in the source and recompile. This cannot be done piece-wise. You must convert all classes and interfaces that are referenced by an application. Conversion is not required, but is highly recommended. Future releases of Oracle may have features that are incompatible with use of the package oracle.jdbc.driver.
The purpose of this change is to enable the Oracle JDBC drivers to have multiple implementations. In all releases up to and including Oracle9i, all of the Oracle JDBC drivers have used the same top level implementation classes, the classes in the package oracle.jdbc.driver. By converting your code to use oracle.jdbc, you will be able to take advantage of future enhancements that use different implementation classes. There are no such enhancements in Oracle9i, but there are plans for such enhancements in the future.
Additionally, these interfaces permit the use of some code patterns that are difficult to use when your code uses the package oracle.jdbc.driver. For example, you can more easily develop wrapper classes for the Oracle JDBC classes. If you wished to wrap the OracleStatement class in order to log all SQL statements, you could easily do so by creating a class that wraps OracleStatement. That class would implement the interface oracle.jdbc.OracleStatement and hold an oracle.jdbc.OracleStatement as an instance variable. This wrapping pattern is much more difficult when your code uses the package oracle.jdbc.driver as you cannot extend the class oracle.jdbc.driver.OracleStatement.
Once again, your code should use the new package oracle.jdbc instead of the package oracle.jdbc.driver. Conversion is not required as oracle.jdbc.driver will continue to be supported for backwards compatibility. Conversion is highly recommended as there may in later releases be features that are not supported if your code uses oracle.jdbc.driver.
可见,从oracle9i开始,使用oracle.jdbc.OracleDriver代替oracle.jdbc.driver.OracleDriver。如果继续使用oracle.jdbc.driver.OracleDriver,在后续可能出现不支持某些功能。oracle.jdbc.OracleDriver 继承oracle.jdbc.driver.OracleDriver,是为了与老版本兼容。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
安装教程 eclipse中maven 下载不到oracle数据库驱动 ojdbc5 ojdbc6 需要我们手动将驱动安装到本地仓库 https://blog.csdn.net/az44yao/article/details/87773714 参考地址: http://www.oracle.com/technetwork/cn/articles/oem/jdbc-112010-094555-zhs.html 针对所有平台的 JDBC 瘦客户端 ojdbc5.jar (1,996,228 字节)— 用于 JDK 1.5 的类。它包含 JDBC 驱动程序类,但不包含在 Oracle Object 和 Collection 类型中支持 NLS 的类。 ojdbc5_g.jar (3,081,328 字节)— 与 ojdbc5.jar 一样,除了类通过“javac -g”编译并包含跟踪代码。 ojdbc6.jar (2,111,220 字节)— 用于 JDK 1.6 的类。它包含 JDBC 驱动程序类,但不包含在 Oracle Object 和 Collection 类型中支持 NLS 的类。 ojdbc6_g.jar (3,401,519 字节)— 与 ojdbc6.jar 一样,除了通过“javac -g”编译并包含跟踪代码。 ojdbc5dms.jar (2,429,777 字节)— 与 ojdbc5.jar 一样,除了包含支持 DMS 和有限的 java.util.logging 调用的工具。 ojdbc5dms_g.jar (3,101,875 字节)— 与 ojdbc5_g.jar 一样,除了包含支持 DMS 的工具。 ojdbc6dms.jar (2,655,741 字节)— 与 ojdbc6.jar 一样,除了包含支持 DMS 和有限的 java.util.logging 调用的工具。 ojdbc6dms_g.jar (3,423,263 字节)— 与 ojdbc6_g.jar 一样,除了包含支持 DMS 的工具。 orai18n.jar (1,656,280 字节)— 用于 JDK 1.5 和 1.6 的 NLS 类。它包含在 Oracle Object 和 Collection 类型中支持 NLS 的类。该 jar 文件代替旧的 nls_charset jar/zip 文件。 demo.zip (603,363 字节)— 包含 JDBC 示例程序。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值