These instructions assume that you are using DB2 Universal Database and guide you through the following tasks:
Note: When you create and access the ROUTING_TABLE table, 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 following db2level command:
CREATE DB ROUTING CONNECT TO ROUTING 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 following db2level command:CREATE DB ROUTING CONNECT TO ROUTING BIND install_dir/bnd/@db2cli.lst grant public CLIPKG 5 TERMINATE
db2start
db2 -vf routing1.sql
CONNECT TO ROUTING DROP TABLE ROUTING_TABLE CREATE TABLE ROUTING_TABLE (Variable1 varchar(32),Variable2 varchar(32),Variable3 varchar(32), queue_manager varchar(48),queue_name varchar(48)) INSERT INTO ROUTING_TABLE VALUES('SAMPLE_QUEUES', 'default','default', 'MB8QMGR', 'ROUTING.DEFAULT') INSERT INTO ROUTING_TABLE VALUES('SAMPLE_QUEUES', 'TD', 'Montana', 'MB8QMGR', 'ROUTING.OUT1') INSERT INTO ROUTING_TABLE VALUES('SAMPLE_QUEUES', 'DL', 'Corleone', 'MB8QMGR', 'ROUTING.OUT2') INSERT INTO ROUTING_TABLE VALUES('SAMPLE_QUEUES', 'AA', 'Pacino', 'MB8QMGR', 'ROUTING.OUT3') INSERT INTO ROUTING_TABLE VALUES('SAMPLE_QUEUES', 'RJ', 'DeNiro', 'MB8QMGR', 'ROUTING.OUT4') INSERT INTO ROUTING_TABLE VALUES('SAMPLE_QUEUES', 'KF', 'Cobain', 'MB8QMGR', 'ROUTING.OUT5') INSERT INTO ROUTING_TABLE VALUES('SAMPLE_QUEUES', 'JE', 'Matrix', 'MB8QMGR', 'ROUTING.OUT6') INSERT INTO ROUTING_TABLE VALUES('SAMPLE_QUEUES', 'PL', 'Parker', 'MB8QMGR', 'ROUTING.OUT7') INSERT INTO ROUTING_TABLE VALUES('SAMPLE_QUEUES', 'CJ', 'Kent', 'MB8QMGR', 'ROUTING.OUT8') INSERT INTO ROUTING_TABLE VALUES('SAMPLE_QUEUES', 'MA', 'Douglas', 'MB8QMGR', 'ROUTING.OUT9') INSERT INTO ROUTING_TABLE VALUES('SAMPLE_QUEUES', 'JD', 'Travolta', 'MB8QMGR', 'ROUTING.OUT10') INSERT INTO ROUTING_TABLE VALUES('SAMPLE_QUEUES', 'HO', 'Ramsden', 'MB8QMGR', 'ROUTING.OUT11') INSERT INTO ROUTING_TABLE VALUES('SAMPLE_QUEUES', 'KA', 'Stewart', 'MB8QMGR', 'ROUTING.OUT12') INSERT INTO ROUTING_TABLE VALUES('SAMPLE_QUEUES', 'LS', 'Skywalker', 'MB8QMGR', 'ROUTING.OUT13') INSERT INTO ROUTING_TABLE VALUES('SAMPLE_QUEUES', 'KD', 'Minogue', 'MB8QMGR', 'ROUTING.OUT14') INSERT INTO ROUTING_TABLE VALUES('SAMPLE_QUEUES', 'PP', 'Pitstop', 'MB8QMGR', 'ROUTING.OUT15') INSERT INTO ROUTING_TABLE VALUES('SAMPLE_QUEUES', 'JA', 'Reeve', 'MB8QMGR', 'ROUTING.OUT16') INSERT INTO ROUTING_TABLE VALUES('SAMPLE_QUEUES', 'JA', 'Hetfield', 'MB8QMGR', 'ROUTING.OUT17') INSERT INTO ROUTING_TABLE VALUES('SAMPLE_QUEUES', 'DT', 'Zuko', 'MB8QMGR', 'ROUTING.OUT18') INSERT INTO ROUTING_TABLE VALUES('SAMPLE_QUEUES', 'KA', 'Braithwaite', 'MB8QMGR', 'ROUTING.OUT19') TERMINATE
db2 -vf routing2.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:
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.ROUTING_TABLE" is an undefined name. SQLSTATE=42704
Ignore this message. The message is displayed because the script attempts to remove an existing table called ROUTING_TABLE before it creates a new table but, if you have not run the script before, the script cannot find an existing table.
For instructions, see Enabling ODBC connections to the databases in the WebSphere Message Broker documentation.