title: List all the lotus notes database
body: <p>I tried to create a lotus notes client using Java. Now, I have a problem to list all the user defined databases. What I tried to do is </p>
  
  <pre><code>// testing purpose
  private void printAllDb() throws NotesException
  {
      DbDirectory dir = session.getDbDirectory(host);
      String server = dir.getName();
      if(server.equals(""))
      {
          server = "Local";
      }
  
      System.out.println("database direcory list on server (" + server + ")");
      Database db = dir.getFirstDatabase(DbDirectory.DATABASE);
  
      do
      {
          System.out.println("file name: " + db.getFileName().toUpperCase() + " - " + db.getTitle());
  
      } while((db = dir.getNextDatabase()) != null);
  
  }
  </code></pre>
  
  <p>However, the program will throw the exception:</p>
  
  <pre><code>Exception in thread "main" NotesException: Server access denied
  at lotus.domino.NotesExceptionHelper.read(Unknown Source)
  at lotus.domino.NotesExceptionHolder._read(Unknown Source)
  at lotus.priv.CORBA.iiop.RepImpl.invoke(Unknown Source)
  at lotus.priv.CORBA.portable.ObjectImpl._invoke(Unknown Source)
  at lotus.domino.corba._IDbDirectoryStub.getFirstDatabase(Unknown Source)
  at lotus.domino.cso.DbDirectory.getFirstDatabase(Unknown Source)
  at nz.co.sylresearch.sylsearch.agents.lotusnotes.LotusNotesAPIHandler.printAllDb(LotusNotesAPIHandler.java:58)
  at nz.co.sylresearch.sylsearch.agents.lotusnotes.LotusNotesAPIHandler.main(LotusNotesAPIHandler.java:44)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:606)
  at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
  </code></pre>