Oracle 瘦驱动程序与 OCI 驱动程序。优点和缺点?
当您开发与 Oracle DB 通信的 Java 应用程序时,有 2 个选项,对吗?一种是oracle Thin驱动,另一种是OCI驱动,需要自己安装(如有误解,请指正)。
现在,有哪些优点和缺点?显然thin驱动程序在安装方面听起来要好得多,但是有什么是OCI可以而thin驱动程序不能的吗?
开发环境为Tomcat6 + Spring 3.0 + JPA(Hibernate) + apache-DBCP
When you develop a Java application that talks to oracle DBs, there are 2 options right? One is oracle thin driver, and the other is OCI driver that requires its own installation (please correct if I'm misunderstanding).
Now, what are the pros and cons? Obviously thin driver sounds much better in terms of installation, but is there anything that OCI can and the thin one can't?
Develop environment is Tomcat6 + Spring 3.0 + JPA(Hibernate) + apache-DBCP
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
驱动程序的选择取决于几个因素。对数据库的调用的性质(例如,您的应用程序似乎不会使用大量存储的过程调用)、故障转移的要求(例如集群 Oracle 服务器)和分布式事务。一般来说,建议使用精简驱动程序,但如果 OCI 驱动程序有某些特定功能是您必须具备的,则可能需要考虑 OCI 驱动程序。还有人说,Oracle 10 及更高版本中的驱动程序确实具有匹配的功能,并且在现代 JVM 上几乎没有性能差异。
The choice of the driver depends several factors. The nature of your calls to database (e.g. it seem like your app won't be using lots of stored proc calls), requirements for failover (e.g. clustered Oracle servers) and distributed transactions. Generally it is recommended to use the thin driver, but if there is some specific feature of the OCI driver that you just must have you may have to consider the OCI driver. It also been said that drivers in Oracle 10 and higher do have matching capabilities and there is practically no performance difference on modern JVMs.
除非您依赖于仅在 JDBC-OCI 驱动程序中可用而不在 JDBC-thin 驱动程序中可用的功能,否则 Oracle 建议使用 Thin。最新的 Oracle 数据库功能(例如事务防护或应用程序连续性)仅在 JDBC 瘦驱动程序中可用。瘦驱动程序也比 JDBC-OCI 驱动程序使用得更多,因此可以更快地修复错误。它被认为更稳定。如果您仍然不相信,请认为 Oracle Weblogic Server 仅附带 JDBC 瘦驱动程序。
Unless you have a dependency on a feature that is only available in the JDBC-OCI driver and not in the JDBC-thin driver, the recommendation from Oracle is to use thin. The most recent Oracle Database features such as Transaction Guard or Application Continuity are only available in the JDBC-thin driver. The thin driver is also more used than the JDBC-OCI driver so bugs will be fixed more quickly. It's considered as more stable. If you're still not convinced think that Oracle Weblogic Server ships with the JDBC-thin driver only.