Step 4: Creating a data source and connection pool

Create a JDBC data source and connection pool.

Procedure

  1. In the WebLogic Server administration console, in Domain Configurations, under Services click Data Sources.
  2. In the Summary of JDBC Data Sources page, on the Configuration tab, in the Data Sources table, click New > Generic Data Source.
  3. In the Create a New JDBC Data Source page, name your data source (for example, Rule Execution Server Data Source) and type jdbc/resdatasource for the JNDI name.
  4. Select the type from the Database Type drop-down menu and click Next. For example, select Derby.
  5. In the next panel, select a driver from the Database Driver drop-down menu to connect to the database and click Next.

    The best practice is to use the XA database driver.

  6. If you created a connection pool with a non-XA driver and you want to allow your data source to be involved in XA transactions, select Emulate Two-Phase Commit. The Supports Global Transactions option is selected by default. Click Next.
  7. Define the Connection Properties and click Next.
    For example, for a Derby database:
    Table 1. Connection properties for a Derby database
    Property Value
    Database name resdb;create=true
    Host name localhost
    Port number 1527
    Database user name resdbUser
    Password resdbUser
  8. In the Test Database Connection page, click Test Configuration to ensure that the connection pool is operational, and then click Next. If the console displays the following message, your connection pool is ready to be used.
    Connection test succeeded.
  9. In the next panel of the Create a New JDBC Data Source page, in the Servers table, select the AdminServer check box and click Finish.

Results

The display returns to the Summary of JDBC Data Sources page.