This code will create an AS400DB2 table.
Code: import lotus.domino.*;
import java.sql.*;
public class JavaAgent extends AgentBase {
public void NotesMain() {
String url = "jdbc:AS400:servername";
try {
Session session = getSession();
AgentContext agentContext =
session.getAgentContext();
Class.forName
("com.ibm.as400.access.AS400JDBCDriver");
Connection con =
DriverManager.getConnection
(url, "login", "password");
Statement stmt = con.createStatement();
String sql = "Create Table mdm.
Profile1(fName char(30), lName
char(50), Add1 char(50), Add2 char(30),
City char(30), State char(30), Zip char
(10), Phone1 char(20), Phone2 char(20),
Fax1 char(20), email1 char(100),
WebSite1 char(100), hDate Dec(8,0))";
stmt.executeUpdate(sql);
} catch(Exception e) {
e.printStackTrace();
}
}
}
Do you have comments on this tip? Let us know.
This tip was submitted to the SearchDomino.com tip exchange by member Mike Marcavage. Please let others know how useful it is via the rating scale below. Do you have a useful Notes/Domino tip or code to share? Submit it to our monthly tip contest and you could win a prize and a spot in our Hall of Fame.