What type of JDBC driver should I use to access the Oracle database?

We are launching the J2EE application inside Tomcat WebServer on AIX.

We need to access several views and stored procedures of the Oracle database. This oracle data-date is not the one on which our application is based, but an external system with which we must communicate.

As far as I can tell, we are going to bypass 1000 SELECT per minute at high load and several stored procedure calls per hour, if any.

What type of JDBC driver is best used in this situation?

As far as I understand, type 4 seems to be suitable, but I could not find a definite statement about this by Oracle or any other reliable source.

+4
source share
3 answers

The Type 4 driver (thin) is the recommended driver from Oracle.

The only reason to use the OCI driver ("thick") is when you need advanced RAC features such as transparent failover (TAF). Otherwise, using a thin driver is recommended.

See the JDBC Developer's Guide for more details:
http://download.oracle.com/docs/cd/B28359_01/java.111/b31224/overvw.htm#BABCHIGI

The most important suggestion is probably:

In general, if you don't need OCI-specific features, such as support for non-TCP / IP networks, use the JDBC Thin driver.

+6
source

From my experience, I would suggest using the Thin driver. However, there are three situations in which I advised OCI:

  • The DB and JVM running your program are on the same host. In this case, the OCI will lower the TCP / IP layer, and communication may be faster.
  • To connect to the database, you only need the Oracle SID, since the full client is used. You do not need the full database url. This can be useful when setting up in a dev / test / prod environment.
  • You often call stored procedures (I mean this!).
+3
source

Type 4 is the way to go, but you can decide for yourself by going through the pros / cons listed here.

+1
source

Source: https://habr.com/ru/post/1337954/


All Articles