User Guide

18 Chapter 1 Advanced Data Source Management
you create a database, it is automatically cataloged on the server with the database
alias (
database_alias) the same as the database name (database_name). The client
uses the information in the database directory, along with the information in the
node directory, to establish a connection to the remote database.
To add an entry to the client’s database node directory:
1 Run the db2 command line utility db2.
2 At the db2 prompt, enter the following:
db2 => catalog database sample as sample1 at node dbserver1node
db2 =>terminate
Test the connection
You are now ready to test the connection with a known table. The following
procedure uses a table that is installed with DB2.
To test the connection:
1 Run the DB2 command line utility db2.
2 At the db2 prompt, enter the following:
db2 => connect to sample1 user username using password
db2 => select * from employee
db2 => terminate
Data source and start script settings for DB2 (UNIX)
This section describes changes that you must make to the ColdFusion start script.
You must set the following environment variables in the <installdir>/coldfusion/
bin/start script file:
# DB2 environment variables
DB2INSTANCE=db2inst1
INSTHOME=/export/home/db2inst1
# Set library search path
#
# NOTE: Add your database client library directory to the FRONT of this
list
#
# Example:
#
LD_LIBRARY_PATH=/usr/dt/lib:/lib:/usr/openwin/lib:$INSTHOME/sqllib/
lib:$CFHOME/lib
#
# This is the list of variables that ColdFusion will see
# Add any special Database environment variables here
#
VAR_LIST="LD_LIBRARY_PATH DB2INSTANCE INSTHOME CFHOME SYBASE
ORACLE_HOME INFORMIXDIR INFORMIXSERVER II_SYSTEM"