Data source configuration for Java when using Oracle WebLogic Server

Use the WebLogic Server Administration Console to set up a data source.

A data source is a named connection to a database. You must specify a data source within the web application server to publish a feature service to ArcGIS Spatial Data Server for the Java platform. The data source object is configured with a naming service based on the Java Naming and Directory Interface (JNDI) API.

To set up WebLogic to work with PostgreSQL, you must first provide the PostgreSQL JDBC jar file, which is not installed with WebLogic.

Configure an Oracle data source

Steps:
  1. Log in to your WebLogic Server Domain from WebLogic Server Administration Console as the WebLogic administrator.
  2. Expand the Services node in the Domain Structure tree and click Data Sources.
  3. Click New on the Configuration tab of the Summary of JDBC Data Sources page.

    The Create a New JDBC Data Source page opens.

  4. Type a name for your data source in both the Name and JNDI Name text boxes.
    NoteNote:

    The Name and JNDI Name values must be exactly the same and must begin with jdbc/. For example, jdbc/porcupine_osid_pubu.

  5. Choose Oracle from the Database Type drop-down list and click Next.
  6. Choose *Oracle's Driver (Thin) for Instance connections; Versions:9.0.1 and later from the Database Driver drop-down list.
  7. Click Next.
  8. Accept the default values on the Transaction Options page and click Next.
  9. Type the name of the Oracle database in the Database Name text box.
  10. Type the name of the Oracle server in the Host Name text box.
  11. In the Port text box, type the port number used for communication with the Oracle database.
  12. In the Database User Name text box, type the name of the database user you want to use for your data source connection.
  13. Type the password of this user in both the Password and Confirm Password text boxes, then click Next.
  14. Information on the Test Database Connection page will be prepopulated based on information you provided in the wizard.
  15. Click Test Configuration to be sure the information you provided is correct and the data source connection works.
  16. If the configuration is correct, click Next.
  17. Check the box next to the server or cluster to which you want to deploy your JDBC provider, then click Finish.
  18. Click Activate Changes in the Change Center of the WebLogic Administration Console.

The data source is now listed in the Data Sources table.

Configure a PostgreSQL data source

To set up a data source in WebLogic for a PostgreSQL database, you must configure WebLogic to access the PostgreSQL jdbc4.jar file, then use the WebLogic Administration Console to configure the data source.

Configure WebLogic to access the JDBC driver

To set up a data source in WebLogic for a PostgreSQL database, first place the PostgreSQL jdbc4.jar file in the WebLogic home directory, alter WebLogic's CLASSPATH variable, and restart WebLogic to work with a PostgreSQL database.

Steps:
  1. Copy the PostgreSQL postgresql-9.1-801.jdbc4.jar file into the WL_HOME/server/lib directory.
  2. Modify the commEnv.cmd (Windows) or commEnv.sh (Linux) script found in WL_HOME/common/bin, adding the jar file location to the beginning of the WEBLOGIC_CLASSPATH variable.
  3. Restart WebLogic.

Configure the data source

Use the WebLogic Server Administration Console to configure the data source.

Steps:
  1. Log in to your WebLogic Server Domain from WebLogic Server Administration Console as the WebLogic administrator.
  2. Expand the Services node in the Domain Structure tree and click Data Sources.
  3. Click New on the Configuration tab of the Summary of JDBC Data Sources page.

    The Create a New JDBC Data Source page opens.

  4. Type a name for your data source in both the Name and JNDI Name text boxes.
    NoteNote:

    The Name and JNDI Name values must be exactly the same and must begin with jdbc/. For example, jdbc/laverne_pgdb_lri2.

  5. Choose PostgreSQL from the Database Type drop-down list and click Next.
  6. Choose PostgreSQL's Driver (Type 4) Version:Any from the Database Driver drop-down list.
  7. Click Next.
  8. Accept the default values on the Transaction Options page and click Next.
  9. Type the name of the PostgreSQL database in the Database Name text box.
  10. Type the name of the PostgreSQL server in the Host Name text box.
  11. In the Port text box, type the port number used for communication with the PostgreSQL database cluster.
  12. In the Database User Name text box, type the name of the database user you want to use for your data source connection.
  13. Type the password of this user in both the Password and Confirm Password text boxes, then click Next.
  14. Information on the Test Database Connection page will be prepopulated based on information you provided in the wizard.
  15. Click Test Configuration to be sure the information you provided is correct and the data source connection works.
  16. If the configuration is correct, click Next.
  17. Check the box next to the server or cluster to which you want to deploy your JDBC provider, then click Finish.
  18. Click Activate Changes in the Change Center of the WebLogic Administration Console.

The data source is now listed in the Data Sources table.

7/19/2012