DB2 Code Factory online Help
| Prev | Return to chapter overview | Next |
Connection parameters
This topic provides a very general overview of how DB2 Code Factory connects to DB2 databases. Please refer to DB2 documentation for more information on DB2 connections.
DB2 Code Factory unites databases in groups at the Explorer tree. Database group is a pure logical structure and can be named by any convenient appellation (i.e. a database name, a database host, etc.).
To setup a connection to a DB2 database stored on a remote server, you have to get any DB2 client installed on your computer and this database catalogued by db2 on the client machine. The first condition is clear: if you have no DB2 client installed on your machine, run the install program provided on a product CD or download and install the appropriate DB2 client from the publisher's site. The DB2 client can work only with catalogued databases assumed with cataloged nodes (servers). To work with a DB2 database with DB2 Code Factory, you have to get this database catalogued on the client machine (the operation is accomplished only once) and to specify the name of user registered on DB2 server and the corresponding password.
To catalogue a DB2 database, follow the steps below:
1. Catalog the node of server. To get all the catalogued nodes of the client machine, enter the following command to the DB2 Command Window or similar:
db2 list node directory
To catalog a new server node, use the following command:
db2 catalog tcpip node <nodename> remote <hostname or ip address>
server <db2servicename> [remote <instance_name> ostype <OSname>]
nodename – the node name to be used on your computer
hostname or ip address – hostname/ipaddress of server storing the DB2 database
db2servicename – ServiceName or port number of db2instance (db2 get dbm cfg | grep SVCENAME)
instance_name – instance name of db2 database.
OSname – Solaris,windows, AIX, Linux etc.
Example:
db2 catalog tcipnode testnode remote testhost server 50000
db2 catalog tcipnode testnode remote testhost server 50000 remote db2inst1
2. Catalog the necessary database on the corresponding node. To get the list of catalogued databases, use the following command:
db2 list db directory
To add the necessary database to the catalog, enter the following command:
db2 catalog database <dbname> as [<db_alias>] at node <nodename>
dbname – database name
db_alias – optional database alias, if you want database name different on client.
nodename – nodename you created on first step
Example:
db2 catalog database testdb as testdb at node testnode
db2 catalog database sample at node testnode
| Prev | Return to chapter overview | Next |







