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". .
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:
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.