Oracle 瘦驱动程序与 OCI 驱动程序。利弊?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2896265/
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
Oracle thin driver vs. OCI driver. Pros and Cons?
提问by Enno Shioji
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).
当您开发与 oracle DB 对话的 Java 应用程序时,有两种选择,对吗?一个是oracle的瘦驱动,另一个是OCI驱动,需要自己安装(理解有误请指正)。
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?
现在,利弊是什么?显然,瘦驱动在安装方面听起来要好得多,但是有什么是 OCI 可以而瘦驱动不能的呢?
Develop environment is Tomcat6 + Spring 3.0 + JPA(Hibernate) + apache-DBCP
开发环境为Tomcat6 + Spring 3.0 + JPA(Hibernate) + apache-DBCP
采纳答案by Eugene Kuleshov
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.
驱动程序的选择取决于几个因素。您对数据库的调用的性质(例如,您的应用程序似乎不会使用大量存储的 proc 调用)、故障转移的要求(例如集群 Oracle 服务器)和分布式事务。一般建议使用瘦驱动,但如果有一些 OCI 驱动的特定功能是你必须拥有的,你可能需要考虑 OCI 驱动。也有人说 Oracle 10 和更高版本中的驱动程序确实具有匹配功能,并且在现代 JVM 上几乎没有性能差异。
回答by Jean de Lavarene
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.
除非您依赖于仅在 JDBC-OCI 驱动程序中可用而不在 JDBC-thin 驱动程序中可用的功能,否则 Oracle 的建议是使用瘦。事务保护或应用程序连续性等最新的 Oracle 数据库特性仅在 JDBC 瘦驱动程序中可用。瘦驱动程序也比 JDBC-OCI 驱动程序使用得更多,因此可以更快地修复错误。它被认为更稳定。如果您仍然不相信 Oracle Weblogic Server 只附带 JDBC-thin 驱动程序。