Sample: Using Data Access Beans to Access Notes

Objective
This sample shows how to use Data Access Beans to access a Domino database.

Time Required
To run the sample with its supplied content and look over the output, you will probably want to allow about 20 or 30 minutes.

Before You Begin
You need to have the following tools:

Follow the steps the Domino Samples Overview to set up your Lotus Notes and VisualAge for Java environments.

Description
This sample retrieves information from a Domino database using the NotesSQL ODBC driver that is accessed with Java using the  Data Access Beans, and displayed using Swing beans.  This sample is in the IBM Domino Examples project and is called com.ibm.ivj.examples.domino.dasample.

Check your Path
To ensure that your path includes all of the necessary pointers:

  1. Expand your com.ibm.ivj.examples.domino.dasample package.
  2. In the Workbench, select the DAApplet class with mouse button 2.
  3. Select Properties.  The Properties for DAApplet notebook will open.
  4. Select the Extra directories path checkbox.  Click Edit.
  5. Click Add Jar/Zip.
  6. Locate and add the path to sqllib\java\db2java.zip.
  7. Click OK to close the VisualAge window
  8. Click OK to close the notebook.

Run as an Applet

  1. Select the DAApplet class in the Workbench with mouse button 2.
  2. Select Run - In Applet Viewer.  The Applet viewer will open.
  3. Use the toolbar at the bottom of the applet to scroll through the members of the department.  On the toolbar, the button with a picture of a person on it is used to get the data from the database.  The arrow buttons will help you navigate through the database and the final button is used to refresh the information.

Run as an Application

  1. Select the DAApplet class in the Workbench with mouse button 2.
  2. Select Run - Run main.  The application will open.
  3. Use the toolbar at the bottom of the applet to scroll through the members of the department.  On the toolbar, the button with a picture of a person on it is used to get the data from the database.  The arrow buttons will help you navigate through the database and the final button is used to refresh the information.