Objectives
The objectives of this sample are:
Time Required
Allow 30 minutes to create and run this sample.
Before You Begin
To build and run this sample you need:
Follow the steps in the Domino Samples Overview to prepare for the sample. If you want to use the AgentRunner you also have to follow the steps in Setting Up For the AgentRunner.
Preparation for DB2
To set your DB2 userid and password in the source code:
connectObject = DriverManager.getConnection(url, "USERID",
"PASSWORD");
USERID
" and "PASSWORD
"
to the userid and password with which you connect to DB2.To set your classpath:
Description
This sample shows a Lotus Notes agent that runs automatically when new mail arrives. It
checks the incoming mail to see if it is a special mail request that matches a certain
format. If so, the mail is read and a database query is run. The results of the
query are send back to the original sender of the mail message.
To setup Notes to run the agent, do the following:
CheckMail
Running the Agent
To query your Notes database, send yourself a mail message with DBQUERY as the subject and
DATABASE: NOTES DeptDesc.nsf
QUERY: SELECT Deptno,Deptname WHERE Deptno='E11'
as the body of the message.
To query your DB2 database, send yourself a mail message with DBQUERY as the subject and
DATABASE: DB2 JDBC:DB2:SAMPLE
QUERY: Select * from Employee
as the body of the message.
The results of the query will be sent to you as a mail message.