You can run CLI and ODBC applications
against a Db2®
database server using the IBM® Data Server Client, the IBM Data Server Runtime Client, or the IBM Data Server Driver for ODBC and CLI. However, to compile CLI or ODBC applications,
you need the IBM Data Server Client.
Procedure
In order for a CLI application to
successfully access a Db2 database:
-
Ensure the CLI/ODBC
driver was installed during the Db2 client install.
- For the IBM Data
Server Client and Runtime Client only: If the database is being accessed
from a remote client, catalog the database and hostname of the machine
the database is on.
On Windows operating systems, you can use the CLI/ODBC Settings GUI to catalog
the Db2
database.
- Optional: Explicitly bind the CLI /ODBC bind files to the database with the command:
db2 bind ~/sqllib/bnd/@db2cli.lst blocking all sqlerror continue \
messages cli.msg grant public
On Windows operating systems,
you can use the CLI/ODBC Settings GUI to bind the CLI/ODBC bind files to the database.
- Optional: Change the CLI /ODBC configuration keywords by editing the db2cli.ini file. For information about the location of
the db2cli.ini file, see db2cli.ini initialization file.
On Windows operating systems, you can use the CLI/ODBC Settings GUI to set the CLI/ODBC configuration keywords.
Results
Once you have completed steps 1 to 4, proceed to setting
up your Windows CLI environment, or setting up your Linux® or UNIX ODBC environment if you are running ODBC applications on Linux or UNIX.