For up-to-date product documentation, see the IBM MobileFirst Foundation Developer Center.


Configure WebSphere Application Server for DB2 manually for Application Center

We can set up and configure your DB2® database manually for Application Center with WebSphere® Application Server.


Overview

Complete the DB2 database setup procedure before continuing.


Procedure

  1. Determine a suitable directory for the JDBC driver JAR file in the WebSphere Application Server installation directory.

    • For a stand-alone server, we can use a directory such as was_install_dir/optionalLibraries/IBM/Worklight/db2.
    • For deployment to a WebSphere Application Server ND cell, use was_install_dir/profiles/profile-name/config/cells/cell-name/Worklight/db2.
    • For deployment to a WebSphere Application Server ND cluster, use was_install_dir/profiles/profile-name/config/cells/cell-name/clusters/cluster-name/Worklight/db2.
    • For deployment to a WebSphere Application Server ND node, use was_install_dir/profiles/profile-name/config/cells/cell-name/nodes/node-name/Worklight/db2.
    • For deployment to a WebSphere Application Server ND server, use was_install_dir/profiles/profile-name/config/cells/cell-name/nodes/node-name/servers/server-name/Worklight/db2.

    If this directory does not exist, create it.

  2. Add the DB2 JDBC driver JAR file and its associated license files, if any, to the directory that you determined in step 1.

    We can retrieve the driver file in one of two ways:

  3. Set up the JDBC provider:
    1. In the WebSphere Application Server console, click Resources > JDBC > JDBC Providers.
    2. Select the appropriate scope from the Scope combination box.
    3. Click New.
    4. Set Database type to DB2.
    5. Set Provider type to DB2 Using IBM JCC Driver.
    6. Set Implementation Type to Connection pool data source.
    7. Set Name to DB2 Using IBM JCC Driver.
    8. Click Next.
    9. Set the class path to the set of JAR files in the directory that you determined in step 1, replacing was_install_dir/profiles/profile-name with the WebSphere Application Server variable reference ${USER_INSTALL_ROOT}.
    10. Do not set Native library path.
    11. Click Next.
    12. Click Finish.
    13. The JDBC provider is created.
    14. Click Save.
  4. Create a data source for the Application Center database:
    1. Click Resources > JDBC > Data sources.
    2. Select the appropriate scope from the Scope combination box.
    3. Click New to create a data source.
    4. Set the Data source name to Application Center Database.
    5. Set JNDI Name to jdbc/AppCenterDS.
    6. Click Next.
    7. Enter properties for the data source, for example:

      • Driver type: 4
      • Database Name: APPCNTR
      • Server name: localhost
      • Port number: 50000 (default)

      Leave Use this data source in (CMP) selected.

    8. Click Next.
    9. Create JAAS-J2C authentication data, specifying the DB2 user name and password as its properties. If necessary, go back to the data source creation wizard, by repeating steps 4.a to 4.h.
    10. Select the authentication alias created in the Component-managed authentication alias combination box (not in the Container-managed authentication alias combination box).
    11. Click Next and Finish.
    12. Click Save.
    13. In Resources > JDBC > Data sources, select the new data source.
    14. Click WebSphere Application Server data source properties.
    15. Select the Non-transactional data source check box.
    16. Click OK.
    17. Click Save.
    18. Click Custom properties for the data source, select property currentSchema, and set the value to the schema used to create the Application Center tables (APPSCHM in this example).
  5. Test the data source connection by selecting Data Source and clicking Test Connection.

Parent topic: Configuring the DB2 database manually for IBM MobileFirst Platform Application Center