Setting up IBM DB2
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.
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
- Run DB2 console and execute the
db2start
 command on a CLI to open DB2. Create the database using the following command:
create database <DB_NAME>
Before issuing an SQL statement, establish the connection to the database using the following command:
connect to <DB_NAME> user <USER_ID> using <PASSWORD>
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
- Open the DB2 control center using the
db2cc
command as follows: - 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.
- Click User and Group Objects in the control center tree to create users for the newly created database.
- 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>/lib/
directory.
<DB2_HOME>
refers to the installation directory of DB2 Express-C, and <PRODUCT
_HOME>
refers to the home directory of the EI product.
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.