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:
- VisualAge for Java
- Notes 4.6 or higher
- ODBC
- Notes SQL - this can be downloaded from the Lotus website.
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:
- Expand your com.ibm.ivj.examples.domino.dasample package.
- In the Workbench, select the DAApplet class with mouse button 2.
- Select Properties. The Properties for DAApplet notebook will
open.
- Select the Extra directories path checkbox. Click Edit.
- Click Add Jar/Zip.
- Locate and add the path to sqllib\java\db2java.zip.
- Click OK to close the VisualAge window
- Click OK to close the notebook.
Run as an Applet
- Select the DAApplet class in the Workbench with mouse button 2.
- Select Run - In Applet Viewer. The Applet viewer will open.
- 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
- Select the DAApplet class in the Workbench with mouse button 2.
- Select Run - Run main. The application will open.
- 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.