我应该使用哪种 JDBC 驱动程序类型来访问 Oracle 数据库?
我们正在 AIX 上的 Tomcat Web 服务器内运行 J2EE 应用程序。
我们需要访问 Oracle 数据库的一些视图和存储过程。这个oracle数据库不是我们的应用程序所基于的数据库,而是我们必须与之通信的外部系统。
据我现在所知,在高负载情况下,我们每分钟将获得大约 1000 个 SELECT,每小时将获得一些存储过程调用(如果有的话)。
在这种情况下,哪种 JDBC 驱动程序类型最适合使用?
据我所知,类型 4 似乎是可行的方法,但我还没有找到 Oracle 或其他可靠来源对此的明确声明。
We're running a J2EE Application inside a Tomcat WebServer on AIX.
We need to access a few Views and Stored Procedures of an Oracle Database. This oracle datebase is not the one our application is based on, but an external system we have to communicate with.
As far as I can tell from now, we are going to get around a 1000 SELECTs per minute on high load and a few stored procedure calls per hour, if any.
Which JDBC driver type would be the best to use in this situation?
As far as I have gathered type 4 seems to be the way to go, but I haven't been able to find a definite statement about this by Oracle or some other reliable source.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Type 4(“瘦”)驱动程序是 Oracle 推荐的驱动程序。
使用 OCI(“厚”)驱动程序的唯一原因是当您需要 RAC 的高级功能(例如透明应用程序故障转移 (TAF))时。对于其他一切,建议使用瘦驱动程序。
有关详细信息,请参阅 JDBC 开发人员指南:
http://download.oracle.com/docs /cd/B28359_01/java.111/b31224/overvw.htm#BABCHIGI
最重要的一句话可能是:
The Type 4 ("thin") driver is the recommended driver by Oracle.
The only reason to use the OCI ("thick") driver is when you need the advanced features of a RAC such as transparent application failover (TAF). For everything else the thin driver is recommended.
See the JDBC Developer's Guide for details:
http://download.oracle.com/docs/cd/B28359_01/java.111/b31224/overvw.htm#BABCHIGI
The most important sentence is probably:
根据我的经验,我建议使用 Thin 驱动程序。然而,在 3 种情况下,我建议 OCI:
From my experience I'd suggest using Thin driver. However there are 3 situations in which I'd advice OCI:
类型 4 似乎是可行的方法,但您可以通过优缺点来决定 此处列出。
Type 4 seems to be the way to go but you can decide yourself by going through the pros/cons listed here.