IBM Books

Building Applications for UNIX** Environments


Chapter 2. Setup

Before you can use the DB2 SDK to develop applications, you need to set up your programming environment for DB2. It is recommended that you ensure that your existing environment is correctly set up by first building a non-DB2 application. Then, if you encounter any problems, please see the documentation that comes with your compiler or interpreter.

To set up your programming environment for DB2, the following must be installed and working:

For more detailed information on installation and setup, refer to the Quick Beginnings for UNIX book.

When the above are installed and working, you can set up your environment by following the steps in the section "Setting Your Environment". .

After you set up your environment, you may want to set up the sample database, which is used by the examples in this book. To create the database, see "Creating, Cataloging, and Binding the Sample Database". .


Setting Your Environment

You need to set environment variables so you can access the database instance that was created when the database manager was installed. The Quick Beginnings for UNIX book provides general information about setting environment variables. This section provides specific instructions on setting environment variables to access a database instance.

Each database manager instance has two files, db2profile and db2cshrc, which contain scripts to set the environment variable for that instance. Depending on the shell you are using, run the script by entering:

For Korn shell:
. $HOME/sqllib/db2profile

For C shell:
source $HOME/sqllib/db2cshrc

where $HOME is the home directory of the instance owner.

For your convenience, you may want to include this command in your .profile file, so that it runs automatically when you log on.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]

[ DB2 List of Books | Search the DB2 Books ]