Domino Code Fragment

Code Name*
AddressBooks property
Date*
04/29/2024
Source (or email address if you prefer)*
Rlatulippe@romac.com
IP address:.3.137.192.3
Description*
This program prints the server name (or "Local"), file name, and title of all the address books known to the current session.
Type*
Java
Categories*
(Misc)
Implementation:
Required Client:
Server:
Limitations:
Comments:
Files/Graphics attachments (if applicable): Code:
import java.util.*;
import lotus.notes.*;


class addressbooks extends NotesThread
{
 public static void main(String argv[])
   {
       addressbooks t = new addressbooks();
       t.start();
   }


 public void runNotes()
   {
   try
     {
       Session s = Session.newInstance();
       Database db;
       Vector books = s.getAddressBooks();
       Enumeration e = books.elements();
       while (e.hasMoreElements()) {
         db = (Database)e.nextElement();
         String fn = db.getFileName();
         String server;
         if (db.getServer() != null)
           server = db.getServer();
         else
           server = "Local";
         String title = db.getTitle();
         System.out.println
         (server + " " + fn + " \"" + title + "\"");
         }
     }
   catch (Exception e)
     {
       e.printStackTrace();
     }
   }
}