Java connection to a notes database

I am currently attempting to write a Java application that is capable of accessing a lotus notes database. So far I have not been able to establish a successful connection with the lotus notes server, and am hoping that someone will be able to show me the error of my ways.

The server is running notes on a standalone machine. I am attempting to access it via a CORBA connection using the code shown below.

I have my classpaths set correctly and am using the NCSO.jar file that resides on my notes server.

The code is as follows


package pk_lotus_test;

import lotus.domino.*;

import java.awt.*;

import java.awt.event.*;

public class lotus_test

{

public static final String lotus_database = "DATABASE.NSF";

// the session object

  protected Session notes_session;

  // the database object

  protected Database noted_db;

  // the command

  protected String notes_command;

  // the command parameter

  protected String notes_command_parameter;

  // the host domain name/IP address

  

  protected String notes_domain ;

  // the domino user

  protected String notes_username; 

  // the domino user password

  protected String notes_user_password ;

public lotus_test()

{

notes_domain = "HOST NAME";

notes_username = "USERNAME";

notes_user_password = "PASSWORD";

}

public static void main(String args)

{

lotus_test lotus_test = new lotus_test();



System.out.println("JAVA APPLICATION STARTED");



try {

//lotus_test.notes_session = NotesFactory.createSession(lotus_test.notes_domain);

lotus_test.notes_session = NotesFactory.createSession(lotus_test.notes_domain, lotus_test.notes_username, lotus_test.notes_user_password);

} catch (NotesException e) 

{

  //System.out.println("error");

  System.err.println("error" + e.id + " - - " + e.text);

}

}

}


when I run this code I get the following error:

JAVA APPLICATION STARTED

error4486 - -

Process exited with exit code 0.


The error code = Public Const lsERR_NOTES_INVALID_USERNAME_PASSWD = 4486

I have even tried downloading the examples that are in the java toolbox on the sandbox and I can’t manage to get those to execute correctly either.

I’d appreciate any help adviec that you may have.

Thanks in advance for your help

David Ferguson.

Subject: Java connection to a notes database

What are you using for the username value? If you are using anything other than “Firstname Lastname” (such as a short name) you may not be able to authenticate.

Subject: Delete