Application Building Guide

Binding

If you will be accessing the sample database on the server from a remote client that is running a different version of DB2 or running on a different operating system, you need to bind the database utilities, including the DB2 CLI, to the sample database.

Binding creates the package that the database manager needs in order to access the database when an application is executed. Binding can be done explicitly by specifying the BIND command against the bind file created during precompilation.

The Command Reference provides general information about binding the database utilities. This section provides specific instructions to bind the database utilities to the sample database.

You bind the database utilities differently depending on the platform of the client workstation you are using.

On an OS/2 Client Workstation:

  1. Connect to the sample database by entering:
       db2 connect to sample user userid using password
    

    where userid and password are the user ID and password of the instance where the sample database is located.

    The utilities will be automatically bound to the database by DB2 with this command, so the user does not have to explicitly bind them.

  2. Exit the Command Line Processor, and verify that the bind was successful by checking the bind message file bind.msg.

On a UNIX Client Workstation:

  1. Connect to the sample database by entering:
       db2 connect to sample user userid using password
    

    where userid and password are the user ID and password of the instance where the sample database is located.

  2. Bind the utilities to the database by entering:
       db2 bind BNDPATH/@db2ubind.lst blocking all sqlerror continue \
       messages bind.msg
     
       db2 bind BNDPATH/@db2cli.lst blocking all sqlerror continue \
       messages cli.msg
    

    where BNDPATH is the path where the bind files are located, such as $HOME/sqllib/bnd, where $HOME is the home directory of the DB2 instance owner.

  3. Verify that the bind was successful by checking the bind message files bind.msg and cli.msg.

On a Client Workstation running a Windows 32-bit operating system:

  1. From the Start Menu, select Programs.
  2. From the Programs Menu, select IBM DB2.
  3. From the IBM DB2 menu, select the DB2 Command Window.

    The command window displays.

  4. Connect to the sample database by entering:
       db2 connect to sample user userid using password
    

    where userid and password are the user ID and password of the instance where the sample database is located.

  5. Bind the utilities to the database by entering:
       db2 bind "%DB2PATH%\bnd\@db2ubind.lst" blocking all
       sqlerror continue messages bind.msg
    

    where %DB2PATH% is the path where DB2 is installed.

  6. Exit the command window, and verify that the bind was successful by checking the bind message file, bind.msg.

For all Platforms

If you created the sample database on a DRDA-compliant application server, specify one of the following .lst files instead of db2ubind.lst :

ddcsmvs.lst
for DB2 for OS/390

ddcsvm.lst
for DB2 for VM

ddcsvse.lst
for DB2 for VSE

ddcs400.lst
for DB2 for AS/400

The Quick Beginnings book for your operating system provides general information about binding the database utilities.


[ Top of Page | Previous Page | Next Page ]