If the directory/file paths specified in this guide do not exist in your WSO2 product, see Directory Structure of WSO2 Products to locate the paths applicable to your product.
Setting up IBM DB2 - Administration Guide 4.4.x - WSO2 Documentation
||
Skip to end of metadata
Go to start of metadata

The following sections describe how to set up an IBM DB2 database to replace the default H2 database in your WSO2 product:

Prerequisites

Download the latest version of DB2 Express-C and install it on your computer.

For instructions on installing DB2 Express-C, see this ebook.

Setting up the database and users

Create the database using either DB2 command processor or DB2 control center as described below.

Using the DB2 command processor

  1. Run DB2 console and execute the db2start command on a CLI to open DB2.
  2. Create the database using the following command:
    create database <DB_NAME>
  3. Before issuing an SQL statement, establish the connection to the database using the following command:
    connect to <DB_NAME> user <USER_ID> using <PASSWORD>
  4. Grant required permissions for users as follows:

    connect to DB_NAME
    grant <AUTHORITY> on database to user <USER_ID>

    For example:

    For more information on DB2 commands, see the DB2 Express-C Guide.

Using the DB2 control center

  1. Open the DB2 control center using the db2cc command as follows:

  2. Right-click All Databases in the control center tree (inside the object browser), click Create Database, and then click Standard and follow the steps in the Create New Database wizard.
  3. Click User and Group Objects in the control center tree to create users for the newly created database.
  4. Give the required permissions to the newly created users. 

Setting up DB2 JDBC drivers

Copy the DB2 JDBC drivers (db2jcc.jar and db2jcc_license_c0u.jar) from <DB2_HOME>/SQLLIB/java/ directory to the <PRODUCT_HOME>/repository/components/lib/ directory.

<DB2_HOME> refers to the installation directory of DB2 Express-C, and <PRODUCT _HOME> refers to the directory where you run the WSO2 product instance.

What's next

By default, all WSO2 products are configured to use the embedded H2 database. To configure your product with IBM DB2, see Changing to IBM DB2.

  • No labels