This code will delete 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();
stmt.executeUpdate("DROP TABLE mdm.Profile1");
} 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.
This was first published in January 2005