1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 package de.bea.domingo.samples;
24
25 import java.util.Iterator;
26
27 import de.bea.domingo.DDatabase;
28 import de.bea.domingo.DNotesException;
29 import de.bea.domingo.DNotesFactory;
30 import de.bea.domingo.DSession;
31 import de.bea.domingo.DView;
32 import de.bea.domingo.DViewEntry;
33
34 /***
35 * A simple example accessing the local NAB.
36 *
37 * <p>The file NCSO.jar from the Lotus Domino server must be in the classpath to
38 * run this test.</p>
39 *
40 * @author <a href=mailto:kriede@users.sourceforge.net>Kurt Riede</a>
41 */
42 public final class CorbaNAB {
43
44 /***
45 * Main method of sample.
46 *
47 * @param args arguments
48 * @throws DNotesException if the sample fails
49 */
50 public static void main(final String[] args) throws DNotesException {
51
52
53 DNotesFactory factory = DNotesFactory.getInstance();
54
55
56 DSession session = factory.getSession("plato.acme", "Administrator", "password");
57
58
59 DDatabase database = session.getDatabase("", "names.nsf");
60
61
62 DView view = database.getView("($Users)");
63 Iterator allEntries = view.getAllEntries();
64 System.out.println("Content of view ($Users)");
65 while (allEntries.hasNext()) {
66 DViewEntry entry = (DViewEntry) allEntries.next();
67 for (int i = 0; i < entry.getColumnValues().size(); i++) {
68 System.out.print(entry.getColumnValues().get(i) + ", ");
69 }
70 System.out.println();
71 }
72 }
73 }