Is there an example of how to configure the BEA WebLogic Server to use the Oracle Thin JDBC Driver ?

shilpa Tiwari

To do this Oracle's JDBC driver (classes111.zip) should be in your classpath.

I usually put it in the JAVA_CLASSPATH in the startWebLogic.cmd(for NT). For unix it is startWebLogic.sh

NOTE : Service Name( for oracle 8i release 8.1 and higher) is same as Database SID for oracle 8i release 8.0 and lower

if you want to use a weblogic connection pool using the oracle thin driver then add these lines to your weblogic.properties file

weblogic.jdbc.connectionPool.<yourPoolName>= url=jdbc:oracle:thin:@serverName:port:Service Name, driver=oracle.jdbc.driver.OracleDriver, initialCapacity=1, maxCapacity=2, capacityIncrement=1

This will create the connection Pool. You can get DB connections from this pool from your code by

Class.forName("weblogic.jdbc.pool.Driver").newInstance() ; Connection conn = DriverManager.getConnection("jdbc:weblogic:pool:<yourPoolName>", null);

If you do not want to use the WebLogic connection pool then you have to access the DB connections in a regular way from your code