Setting up access to a DB2 database

Before building the application, make sure that you can access the SAMPLE database in DB2 from VisualAge for Java. For this example, we used DB2 Universal Database for Windows NT, Version 5.2.

Checking for the SAMPLE database

  1. From the desktop, select Start and then DB2 for Windows NT.
  2. Select Administration Tools and then Control Center. The Control Center window appears.
  3. Expand the items in the Systems tree until you see Databases. Expand the Databases folder to verify that the SAMPLE database exists.

If the SAMPLE database does not exist on your workstation, consult the documentation for the level of DB2 installed on your workstation.

Setting up access to DB2 from VisualAge for Java

  1. From the menu bar of the Workbench, select Window and then Options.
  2. From the left pane, select Resources.
  3. To the right of the Workspace class path field, select Edit. A dialog appears.
  4. From the dialog, select Add Jar/Zip. A standard file selection window appears.
  5. Within the file selection window, find the sqllib directory created as part of the DB2 installation.
  6. Double-click on the java folder and select db2java.zip.
  7. Select Open.
  8. Select OK to close the dialog.
  9. Select Apply to add the directory to the class path.
  10. Select OK to close the Options window.