This forum is closed to new posts and responses. New discussions are now taking place in the IBM Developer Answers forum.

Nov 1, 2018, 3:28 AM
1 Posts

Java to Lotus Notes connection issue

  • Category: Security
  • Platform: Windows
  • Release: 9.0.1
  • Role: Developer
  • Tags: Notes.jar,Java Lotus Notes Connection issue
  • Replies: 1

I am trying to access the data from Lotus Notes database into an external Java program, but no luck.

On my laptop, I have configured IBM Domino 9.0.1 server, where I have created a demo database. My target is, to access the data from this database through external Java code. I have also installed Netbeans and Eclipse on the same laptop where Domino server is configured. Now, I am trying to access the demo lotus notes database in my java program (netbeans/eclipse) using the classes provided in Notes.jar package, but unable to open database.

To accomplish the task, I have followed below steps:

  • Added the path 'C:\Program Files\IBM\Domino' to 'Path' system variable, and rebooted the laptop.
  • In Netbeans (also tried in Eclipse), created Java class (console application), added Notes.jar file (IBM/Domino/JVM/lib/ext/Notes.jar) in the classpath (in netbeans, added Notes.jar in Resources section. In Eclipse, copied Notes.jar in lib folder).
  • Added the following code in the class: (assume lotus.domino.* is already imported in the code)



    public static void main(String [] args)
            Session session = NotesFactory.createSession()//Connect the server with server ID. Throws error 'Database has not been opened yet';
            //Also tried following options. Note that I have assigned full access/manager rights to anonymous user on the demo database
            //Session session = NotesFactory.createSession((String)null);//Same result as first one [NotesFactory.createSession()]
            //Session session = NotesFactory.createSession((String)null,"Romil Handoo/dev","My_Domino_Internet_Password");//Connect the server as Romil Handoo/dev login. Throws error- Invalid User Id/Password. I am giving correct ID/password
            //Session session = NotesFactory.createSession((String)null,"","");//Access with anonymous user. Throws error 'Database has not been opened yet'**
            Database dbDemo = session.getDatabase(session.getServer(), "demo/DemoDB.nsf");
            //session.getServer() is returning my server name, which is Development/home. 
            //Also tried these, but same result each time: 
            //Following line throws exception 'Database has not been opened yet'
            View vwDemo = dbDemo.getView("vwDemo");
        catch(Exception ex)
            //For case 1, case 2, and case 4, error message is 'Database has not been opened yet'
            //For case 3, error message is 'Invalid login id/password'




Please someone guide me how I may connect to domino database through external java code? For all these steps, I have referred the page

Many thanks

Nov 6, 2018, 11:22 PM
37 Posts
Perhaps it is the database ACL?

I am no Java developer, but perhaps you need to check the database ACL?

As a test, attribute 'Manager' access to 'Anonymous' and 'Default' users and see if you are able to access the database thereafter.

If so, it's a simple security issue.

This forum is closed to new posts and responses. New discussions are now taking place in the IBM Developer Answers forum.