Examples: createCopy method
- This agent makes a local copy of the local database names.nsf.
import lotus.domino.*;
public class JavaAgent extends AgentBase {
public void NotesMain() {
try {
Session session = getSession();
AgentContext agentContext =
session.getAgentContext();
// (Your code goes here)
Database db = session.getDatabase(null, "names");
String title = db.getTitle();
Database db2 = db.createCopy(null, "names2");
db2.setTitle("Copy of names");
System.out.println
("Database \"" + title + "\" copied locally");
} catch(Exception e) {
e.printStackTrace();
}
}
}
- This agent makes a local copy of the local database names.nsf
and sets the maxsize to 2.
import lotus.domino.*;
public class JavaAgent extends AgentBase {
public void NotesMain() {
try {
Session session = getSession();
AgentContext agentContext =
session.getAgentContext();
// (Your code goes here)
Database db = session.getDatabase(null, "names");
String title = db.getTitle();
Database db2 = db.createCopy(null, "names2",2);
db2.setTitle("Copy of names");
System.out.println
("Database \"" + title + "\" copied locally");
} catch(Exception e) {
e.printStackTrace();
}
}
}
Have feedback?
Google Analytics is used to store comments and ratings. To provide a comment or rating for a topic, click Accept All Cookies or Allow All in Cookie Preferences in the footer of this page.