Java and Oracle : JDBC Layers and Connection types

I know no body does that, but I did it anyway :

I read through the JDBC connection types “http://download.oracle.com/javase/6/docs/technotes/guides/jdbc/getstart/intro.html#1019423” and thought I summarize the deferences between JDBC drivr types in this diagram:

JDBC Layers and types from Oracle drivers

Diagram Showing Layers of JDBC and Types with Oracle drivers

In short, there are 4 types of JDBC Connection, but only two are important from my experience:

Type 2 : Which requires the Database drivers to be installed.

  • Thick drivers (access through a DBMS client).
  • url=“jdbc:oracle:oci8:<user>/<pass>@host:port:oracleSID”
  • url=“jdbc:oracle:oci9:<user>/<pass>@host:port:oracleSID”
  • url=“jdbc:oracle:oci10:<user>/<pass>@host:port:oracleSID”

Type 4: Where the connectivity features are completely ported to Java and no need for the DB driver installation.This type is officially called “thin” driver, but in my diagram it the thickest one.

  • Thin drivers ( no need to install a local DBMS driver)
  • url=“jdbc:oracle:thin:<user>/<pass>@host:port:oracleSID”

A lot of debate is about which one is more efficient, but (as far as my experience) there  are sometimes minor functional differences between both.

The diagram is made from an Oracle DBMS perspective, but it is more or less a general picture for other DBMS’s.

One Note about the JDBC URL: you have to define the SID exactly as it is defined on the server listener. if you write “SIDXYZ” it is not the same as “SIDXYZ.WORLD” and “sidxyz.world” and so on.

Please note : that Type 3 is not implement in Oracle.

comments and constructive criticism are highly appreciated.

  • By Warner Doub, December 3, 2010 @ 06:28

    i actually loved reading the blog – it was quite informative free of currently being boring, a little something which is pretty significant.

Other links to this post