Configuring WebSphere Application Server with DB2 as a data source

You must set up a DB2 database and configure the connection with the web app on WebSphere® Application Server

Before you begin

You must create a IBM® DB2® database for the Rational® Publishing Engine web app. The database must have 16K pages and the UTF-8 code set. In this example, the database is named rpedb1. See the DB2 product documentation for information about creating a database.

Procedure

  1. Creating a JDBC provider
  2. Creating the data source for the rpeng application
  3. Creating a data source for the dgaas application
  4. Creating an authentication data entry

Creating a JDBC provider

Procedure

  1. Start WebSphere Application Server.
  2. Open the administrative console in a browser: https://server:port/ibm/console and log in.

    For example: https://localhost:9043/ibm/console

  3. Select Resources > JDBC > JDBC Providers
  4. Set the scope to be the cell.
    Cell
  5. Click New.
  6. In the Create new JDBC provider wizard, select:
    1. Database type: DB2
    2. Provider type: DB2 Universal JDBC Driver Provider
    3. Implementation type : XA data source
    4. Implementation type : Enter a name, for example RPE20.
    Create new JDBC provider wizard
  7. Click Next.
  8. In the Enter database class path information section, enter the class path. Replace DB2UNIVERSAL_JDBC_DRIVER_PATH with the directory where your DB2 .jar files are located:
    <DB2UNIVERSAL_JDBC_DRIVER_PATH>/db2jcc.jar
    <DB2UNIVERSAL_JDBC_DRIVER_PATH>/db2jcc_license_cu.jar
    <DB2UNIVERSAL_JDBC_DRIVER_PATH>/db2jcc_license_cisuz.jar
  9. Enter the directory location for "db2jcc.jar, db2jcc_license_cisuz.jar" which is saved as WebSphere variable ${DB2UNIVERSAL_JDBC_DRIVER_PATH}, for example C:\Program Files\IBM\SQLLIB\java.
  10. Enter the native library path, for example C:\Program Files\IBM\SQLLIB\java.
  11. Click Apply.
    Enter database class path information
  12. Ensure that the native library path is correct and click Next.
    Native library path
  13. Review the summary page and click Finish.
    Native library path
  14. Save the changes to the master configuration.

Creating the data source for the rpeng application

Procedure

  1. Go to the JDBC provider that you just created.
    1. Click Data sources.
      Data sources link
    2. In the Data source name field, enter rpeng.
    3. In the JNDI name field, enter rpeng and click Next.
      Enter basic data source information
  2. Enter database specific properties for the data source and click Next.
    1. Set the Driver Type value to 4.
    2. In the Database Name field, enter the database name.
    3. In the Server Name field, enter the host name of the machine where DB2 is running.
    4. In the Port Number field, enter the port number for your DB2 database.
      Enter database specific properties for the data source
  3. In the Setup security aliases section, click Next .
  4. Review the summary page and click Finish.
    Data source summary
  5. Save the changes to the master configuration.

Creating a data source for the dgaas application

Procedure

Repeat the steps in Creating the data source for the rpeng application, setting DGAAS as the Data source name and DGAAS_DB as the JNDI name.
Enter basic data source information

Creating an authentication data entry

Procedure

  1. Go to the RPE20 JDBC provider and click Data sources.
  2. On the data sources page, click the rpeng data source.
  3. In the Related Items section , click JAAS-J2C authentication data.
  4. Click New.
  5. Enter the DB2 alias, user id and password, and click OK.
    New authentication data
  6. Save the changes to the master configuration.
  7. Go back to your rpeng data source.
  8. In the Security settings, select the rpedb1 database for the following options:
    1. Authentication alias for XA recovery
    2. Component-managed authentication alias
    3. Container-managed authentication alias
    Security settings
  9. Click OK and save.
  10. Go to the rpeng data source again and click Test Connection to test the data source.
    Test connection successful
  11. Repeat steps 7-10 with the dgaas data source.

Feedback