How to get the server name using java code?

Hi, I am working on Lotus notes tools for chekcing the user is authenticated or/not?whether server is running on not such type of work i am doing.

My problem is how to get the server name using java code:

Seesion m_NotesSess = lotus.domino.NotesFactory.createSession();

NotesSess .getServerName(); it is giving empty string.i feel that domino server is running on local…even though i want the server name?Can i get the server name?.

Validating the server is running or not?i am doing in the following way?..

Database m_db = NotesSess.getDatabase(“Notes/NotesOrg”, “names.nsf”);

if (!m_db.isOpen()) {

m_db.open();

}

if(1m_db.isInService()){

//Server is not running.

}

Is this the correct way of doing?..

Please help me on this?

And also i small doubt…

My dominio server is running on different machine

So that case…if i use createSession(hostname,userid,pwd)…do i need diiop.txt?..how i will configure in that case?..

Is there any other way i can find the server is running or not?..

Thanks in Advance…

-----------Sankar