Eclipse or SUNrise...

Eclipse or SUNrise...
...JAVA for sure

Monday, November 22, 2010

Oracle datasource configuration on WAS

Lately, while configuring WebSphere Application Server 6.1 to Oracle 11g database connectivity via datasource I found that there is very little information in WAS documentation explaining couple of things.

The creation of datasource is very similar to other DBs but, the docs really don't say anything about the URL convenience. Sure, there is a sample but without any additional explanation.

  • jdbc:oracle:thin:@host:port:SID


Maybe for Oracle specialist it is clear but it wasn't for me ;-). Firs of all - what does 'thin' mean? Well, it means that we use the standard JDBC type 4 driver (which by default translate JDBC calls into DB calls). We can type also use 'thick', which would mean that we want to use older type (1 or 2) of ODBC drivers.

While configuring the datasource for Oracle on WAS you have to remember also that you have to supply user information (name of user in Oracle is related with database schema). If you won't supply the 'JAAS - J2C authentication data', WAS will report a confusing error about incorrect Oracle destination address. It is because you lack a valid user account.

The last thing about the Oracle configuration is the server. You will have to set a special variable for this:
ORACLE_JDBC_DRIVER_PATH
, which points to a directory with a driver jar. There are couple of versions available: ojdbc14.jar, ojdbc5.jar and ojdbc6.jar (build with Java version 1.4, 5 and 6).

Hope that helped someone :-).

No comments: