Manage Learn to apply best practices and optimize your operations.

Create an AS400DB2 table

This tip gives you code that will create an AS400DB2 table.

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.

Dig Deeper on Java for Lotus Notes Domino

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchDataCenter

SearchContentManagement

Close