嗨,我是 Lotus Script 的新手
我想运行一个访问数据库的 Java 代理来读取表单存储的视图。
我更新了代码
下面是我的代码:
public class JavaAgent extends AgentBase {
public void NotesMain() {
try {
Session session = getSession();
AgentContext agentContext = session.getAgentContext();
// (Your code goes here)
Database db = agentContext.getCurrentDatabase();
View view = db.getView("PetView");
view.setAutoUpdate(false);
view.setAutoUpdate(false);
ViewEntryCollection vec = view.getAllEntries();
System.out.println("Parent is " +
vec.getParent().getName());
System.out.println("Number of entries = " +
vec.getCount());
ViewEntry tmpentry;
ViewEntry entry = vec.getFirstEntry();
while (entry != null) {
System.out.println("Entry is at position " +
entry.getPosition('.'));
tmpentry = vec.getNextEntry();
entry.recycle();
entry = tmpentry;
}
} catch(Exception e) {
e.printStackTrace();
}
}
}
我的调试控制台 O/P 是:
Parent is PetView
Number of entries = 8
Entry is at position 1
Entry is at position 2
Entry is at position 3
Entry is at position 4
Entry is at position 5
Entry is at position 6
Entry is at position 7
Entry is at position 8
如我错了请纠正我
谢谢 。