Java: check for open Notes-DB

Hi,is there a simple way to find out, whether the connection to a Notes-DB has worked or failed?

At the moment I’m using db.isOpen(), but this returns true, even when I’m trying to open a DB w/ wrong filepath or filename. This is the code:

Session s = NotesFactory.createSession(this.hostName, this.username, this.password);

Database db = s.getDatabase(null, this.dbName);

if (db.isOpen()) {

return true;

}

For example: if the variable dbName contains the non-existing path “exmples\mydb.nsf”, isOpen() returns true.

I then tried to use db.getView([viewname]), which generates an error, when db isn’t valid, but then I’ll have to check, if “view” is valid (for I can specify an invalid viewname w/out getting an error) :-/

Any hints will be greatly appreciated!

Greets,

Buzzy