Domino Samples Overview

These samples demonstrate how to use agents, applications and applets to connect to your Domino or DB2 database.

Before You Begin
To run all of the Domino samples you must follow these steps to set up your environment:

1. Add the projects from the repository to your Workbench
The easiest way to add a package to your Workbench is by using Quick Start:

  1. From the Workbench, select the File - Quick Start.
  2. Select Feature from list of categories on the left side of the Quick Start window.
  3. Select Add Feature from the list of options on the right side of the Quick Start window.
  4. Click OK.  The Selection Required window will open.
  5. To select multiple features hold down the the Ctrl key and select the following features with mouse button 1 and select:
    Domino Java class library
    IBM Data Access Beans
    IBM Domino Examples
    Java class libraries
    JFC class libraries
  6. Click OK.  An information window with a progress bar will open to show you what you are adding to your Workbench.  When it is finished, the features you selected will appear as projects in your Workbench.
  7. Open the IBM Domino Examples project to see the Domino samples available.

2.  You must have the DeptDesc.nsf set up in your Domino environment.  Using the command line, copy this file from the X:\IBMVJava\ide\samples directory (where X is the drive onto which you installed VisualAge for Java) into your Y:\notes\data directory (where Y is the drive onto which you installed Notes).

3.  Ensure that JavaDlgSettings is in your notes.ini file and that JavaUserClasses includes a path to your SQLLIB directory.  If you are missing these settings you can cut the following lines and paste them at the end of your notes.ini file.  Make sure that you change the JavaUserClasses path to that of your directory.

JavaDlgSettings=*.class|*.jar,*.cab,*.zip|*.jpg,*.gif,*.au|*.java|1
JavaUserClasses=d:\sqllib\java\db2java.zip

4. After you have changed your notes.ini file, you must close and reopen Notes for the changes to take effect.

5.  Make sure that that Notes is in your PATH statement.  To look at your classpath, enter set classpath on a command line.  If the path to your Notes directory is not in your classpath statement, enter set classpath = %classpath%path/Notes.  Do not close the command window while running this sample.

If you want to add the pointer to notes permanently, set your PATH statement in your computer's system settings.

6. If you are using the AgentRunner you must also follow any other set up steps in Setting Up For the Agent Runner.

Preparation for DB2
For the samples that access DB2, you must add the DB2 class library to the IDE and to your classpath.

To create a project for the DB2 class library:

  1. Create a project for the DB2 class library by selecting a project or package in the Workbench with mouse button 2.
  2. Select Add - Project.  The Add Project SmartGuide will open.
  3. Select the Create a new project named: radio button and enter a name, such as DB2 class library in the text field.
  4. Click Finish.  The project will be added to the Workbench.

To import the classes to the repository:

  1. Select File - Import.  The Import SmartGuide will open.
  2. Select the Jar file radio button.
  3. Click Next.
  4. Type the path to your db2java.zip file or use the Browse option to find the file.
  5. Select the class radio button, then click the Details button beside it.
  6. Select all of the classes and click OK.
  7. Click Finish.

To add the classes to the Workbench:

  1. Select the DB2 class library project with mouse button 2.
  2. Select Add - Package.  The Add Package SmartGuide will open.
  3. Select the Add packages from the repository radio button.
  4. Select the db2java package(s).
  5. Click Finish.

When you use DB2 you must make sure that the DB2 class library is in the classpath for that sample. 

The Samples
Click on a sample name to link to the run and build instructions.

Sample: Using the Domino AgentRunner.  This sample demonstrates how to use the AgentRunner with a simple agent.

Sample: Creating a To Do Agent.  This sample demonstrates how to create an agent that uses Java AWT and NOI.

Sample: Creating an Agent that Searches Your Database. This sample is an agent which runs against a database retrieving all documents which have the same subject as the document you invoke the agent against.

Sample: Query your Domino or DB2 Database.  This sample shows how an agent can access multiple databases.

Sample: Using Data Access Beans to Access Notes.  This sample demonstrates how to use Data Access Beans to access a Domino database.

Sample: Using Swing JTable. This sample shows the use of the database support in Swing 1.0.2 using the JTable class and associated classes.