Create Data Sources for Websphere

Add the JDBC Provider

  1. Select Resources>JDBC>JDBC providers.
  2. Select the scope of the server from the drop-down list (the drop-down list displays if the "Show scope selection drop-down list…" is checked).
  3. Click New.
  4. Select the Database type.
    • For Oracle, select Oracle.
    • For DB2, select DB2.
    • For SQL, select SQL Server.
  5. Select the Provider type.
    • For Oracle, select Oracle JDBC Driver.
    • For DB2, select DB2 Universal JDBC Driver Provider.
    • For SQL, select Microsoft SQL Server JDBC Driver.
  6. Select Implementation type.
    • For Oracle, select XA data source.
    • For DB2, select XA data source.
    • For SQL, select XA data source.
  7. Click Next.
  8. Enter the variable name used for the database driver.
    • For Oracle, enter ${ORACLE_JDBC_DRIVER_PATH}
    • For DB2, click Next.
    • For SQL, click Next.

    Note: For Oracle, skip steps 10 and 11. For DB2, continue at step 10.

  9. Click Finish.
  10. Click on the newly created JDBC provider.
  11. Confirm that the class path field is set to correctly reference the two DB2 and SQL drivers. Refer to the examples below. Edit the field if needed.
  12. For DB2

    • ${DB2UNIVERSAL_JDBC_DRIVER_PATH}/db2jcc4.jar

    For SQL

    • ${MICROSOFT_JDBC_DRIVER_PATH}/sqljdbc4-4.0.jar
  13. Click OK.

Create the Data Sources

Below data sources must be created:

ADMINCONSOLEDS

  1. Select Resources>JDBC>Data sources.
  2. Click New.
  3. For the data source name, enter <DATASOURCE_NAME>.
  4. For the JNDI name, enter <DATASOURCE_NAME>.
  5. Click Next.
  6. Select the JDBC provider created in the last step.
  7. Click Next.
  8. Enter the database connection information.
    • For Oracle, enter the database information in the following format:

    jdbc:oracle:thin:@hostname:port:SID

    • For DB2, enter the database name, hostname and port.
  9. Uncheck the checkbox for Use this data source in container managed persistence.
  10. Click Next.
  11. On the Setup security aliases screen, click Next.
  12. Click Finish.
  13. Select <DATASOURCE_NAME> from the list of data sources that appears.
  14. Select Custom Properties.
  15. Click New to create new variables for each property listed below.
  16. For Oracle:

    1. Name: user; Value: database user name
    2. Name: password; Value: database password

    For DB2:

    1. Name: user; Value: database user name
    2. Name: password; Value: database password
    3. Name: currentSchema; Value: schema name (only needed for readonly data source)

    For SQL:

    1. Name: user; Value: database user name
    2. Name: password; Value: database password
  17. In the Messages area at the top of the screen, click the link for Save to the master configuration.
  18. Once complete, return to the Datasources screen and use the Test Connection button on the main data source list to confirm that the settings were successful for each data source.