BEA Logo BEA WebLogic Server Release 1.1

  Corporate Info  |  News  |  Solutions  |  Products  |  Partners  |  Services  |  Events  |  Download  |  How To Buy

Using the Oracle thin driver with WebLogic Server

 

The Oracle thin driver, is type-4 JDBC driver developed and sold by Oracle. This document describes how to use theOracle thin driver driver in a connection pool running in WebLogic Server. For complete information on using the Oracle thin driver you should consult Oracle's documentation.

WebLogic Server includes BEA's type-2 driver for Oracle, WebLogic jDriver for Oracle, which can also be used to access an Oracle DBMS. This driver requires an Oracle client installation. For additional information, see Installing WebLogic jDriver for Oracle and Using WebLogic jDriver for Oracle.

Creating a connection pool

To create a connection pool:

  1. Modify the classpath used when starting WebLogic Server. Add the classes (or .jar file) for the Oracle driver to the WebLogic Classpath (using the weblogic.class.path property-not the Java System Classpath):

    For more information on setting your classpath, see Setting Classpath in the WebLogic Server installation instructions.

  2. Add one of the following connection pool definitions to your weblogic.properties file, making the correct substitutions for your environment:

    #Oracle thin driver Method #1
    weblogic.jdbc.connectionPool.thinPool=\
    url=jdbc:oracle:thin:DEMO,\
    driver=oracle.jdbc.driver.OracleDriver,\|
    initialCapacity=1,\
    maxCapacity=1,\
    props=user=SCOTT;password=tiger,\
    allow=guest;joe;jill

    (Where DEMO is the name of a host and database defined in the tnsnames file. See your Oracle documentation for more information.)

    #Oracle thin driver Method #2
    weblogic.jdbc.connectionPool.thinPool=\
    url=jdbc:oracle:thin:@hostName:portNumber:databaseName,\
    driver=oracle.jdbc.driver.OracleDriver,\
    initialCapacity=1,\
    maxCapacity=1,\
    capacityIncrement=1,\
    props=user=scott;password=tiger,\
    allow=guest;joe;jill

    (Where hostName is the name of the machine hosting the Oracle DBMS, portNumber is the port where the host machine is listening for requests, and databaseName is the name of the database.)

Additional Resources

Using connection pools with server-side Java (in Using WebLogic HTTP Servlets)

Creating a startup connection pool

BEA WebLogic Server Enterprise JavaBeans