These instructions assume that you are using DB2 Universal Database and guide you through the following tasks:
Note. When you create and access the SROUTEDB tables, be aware of the following issues:
Complete the following steps:
On Windows:
You must replace install_dir with the path to your DB2 product installation directory, for example, C:\PROGRA~1\IBM\SQLLIB. This location can be obtained by using the db2level command.CREATE DB SROUTEDB CONNECT TO SROUTEDB BIND 'install_dir\bnd\@db2cli.lst' blocking all grant public TERMINATE
On Linux:
You must replace install_dir with the path to your DB2 product installation directory. This location can be obtained by using the db2level command.CREATE DB SROUTEDB CONNECT TO SROUTEDB BIND install_dir/bnd/@db2cli.lst grant public CLIPKG 5 TERMINATE
db2start
db2 -vf simplifieddbrouting1.sql
CONNECT TO SROUTEDB DROP TABLE DEPARTMENT CREATE TABLE DEPARTMENT (DEPTNUM CHAR(3) NOT NULL, DEPTNAME VARCHAR(36) NOT NULL, MGRNUM CHAR(6)) INSERT INTO DEPARTMENT VALUES('D00', 'Personnel', '000010') INSERT INTO DEPARTMENT VALUES('D01', 'Development', '000020') INSERT INTO DEPARTMENT VALUES('D02', 'Support', '000030') DROP TABLE EMPLOYEE CREATE TABLE EMPLOYEE (EMPNUM CHAR(6) NOT NULL, FIRSTNM VARCHAR(20) NOT NULL, LASTNM VARCHAR(15) NOT NULL, PHONENUM CHAR(4), WORKDEPT CHAR(3), YEARSSERVICE INTEGER, AGEINYRS INTEGER, SEX CHAR(1), SALARY DECIMAL(9,2)) INSERT INTO EMPLOYEE VALUES('000010', 'DAVID', 'BROWN', '4501', 'D01', 10, 54, 'M', 23250.00) INSERT INTO EMPLOYEE VALUES('000020', 'SALLY', 'KWAN', '4738', 'D00', 9, 27, 'F', 18375.00) INSERT INTO EMPLOYEE VALUES('000030', 'JOHN', 'GEYER', '6789', 'D01', 22, 47, 'M', 53000.00) INSERT INTO EMPLOYEE VALUES('000040', 'EVA', 'SMITH', '7831', 'D00', 12, 37, 'F', 29000.00) TERMINATE
db2 -vf simplifieddbrouting2.sql
Wait for the script to finish running. If you are running the script for the first time, the following message is displayed, where DB2ADMIN is your user name and DEPARTMENT is the name of the table:
DB21034E The command was processed as an SQL statement because it was not a valid Command Line Processor command. During SQL processing it returned: SQL0204N "DB2ADMIN.DEPARTMENT" is an undefined name. SQLSTATE=42704Ignore these messages. The messages are displayed because the script attempts to remove any existing tables called DEPARTMENT and EMPLOYEE before it creates new tables, but if you have not run the script before, the script cannot find any existing tables.
You can now create the JDBCProvider definition, see Creating a JDBC provider entry for a DB2 database.