WebLogic Server™
Examples Database Guide

 

Examples Index      Ant      PointBase      Run Examples with PointBase      Samples and Tutorials

 

 

 

 

Setting Up Examples to Run with an Oracle DBMS

You must run some of the examples in this distribution with an Oracle database, rather than with the demonstration PointBase Server. These examples require that tables be created and exist in an Oracle DBMS before you can run the example. Also, if you simply prefer to run your examples with an Oracle DBMS, use the instructions below as guidelines.

Before you begin, you will need to know certain information about the Oracle database you are using. You will need to know the following values:

DBSERVER--corresponds to the host name of your database server.
DBPORT--corresponds to the port number your database server is running on.
SID--corresponds to the Oracle System Identifier (SID); a logical name that identifies the particular instance of the database you are running.
USER--corresponds to the name of your database server.
PASSWORD--corresponds to the password of your database server.

These values are used to populate the database tables and enable WebLogic to run examples with an Oracle database. Most of your database configuration information for WebLogic , including these values, will be found in the tnsnames.ora file. This configuration file contains net service names mapped to connection descriptors that Oracle uses. The tnsnames.ora file typically resides in $ORACLE_HOME/network/admin on UNIX platforms and ORACLE_HOME\network\admin on Windows platforms. More information on your Oracle setup can be found in the listner.ora file that resides in the same directory. For more information on Oracle and WebLogic see http://e-docs.bea.com/wls/docs70/oracle/index.html also, http://docs.oracle.com/.

  1. Boot up your server and start the Administration Console.
  2. In the left hand pane of the console, expand the JDBC node and then the Connection Pools node. Click on oraclePool.
  3. In the URL window you will see, jdbc:oracle:thin:@server:port:sid. The last three entries in this URL are not valid. Fill in your appropriate server name for @server, this corresponds to the Oracle DBSERVER value mentioned above. Replace the port number with the value your Oracle database uses. Also fill in the appropriate sid, your Oracle System Identifier. Here's an example of what the url could like:

    jdbc:oracle:thin:@myserver:1548:oracle1

  4. Modify your user name in the Properties box to match your Oracle database's username and click on Apply.

  5. Select the Targets tab and target the examples server by adding it to the chosen column. Click Apply.

  6. Return to the left hand pane of the Administration Console and select the Tx Data Sources node and then the examples-dataSource-oracleXAPool. Select the Targets tab and target the examples server by adding it to the chosen column. Click apply.

  7. Set the DBSERVER, USER, and PASSWORD variables in the examples.properties file for your Oracle setup. These variables must be set to the same values as you previously entered through the Administration Console in step 3. The examples.properties file is located in WL_HOME\samples\server\src. The following is an example of how they might be set:

    DBSERVER=myserver
    DBPORT=1548
    SID=oracle1
    USER=adminOracle
    PASSWORD=alligator

  8. Make sure you have set up your environment; run the setexamplesEnv script provided in the WL_HOME \samples\server\config\examples directory. Your PATH should also include the appropriate DLL for your version of Oracle. Add WL_HOME\server\bin\oci817_8 or WL_HOME\server\bin\oci901_8 to your PATH

  9. From within the directory of the example you want to set up, enter the following command:

    ant db_setup_oracle

    This Ant target creates the tables and performs the necessary database setup.

  10. To build, configure, and run the example, return to the example's specific instructions.

If you are using a database server other than PointBase Server or Oracle, create a db_setup_[db vendor] target in the build.xml file, similar to db_setup_oracle, setting the driver class, url, and DBSERVER, USER, and PASSWORD