Hi
I have a piece of Java code in which I want to catch a certain error when trying to get a handle to a database.
Database dbTemp = s.getDatabase(oneServer, s6, false);
if (dbTemp != null) {
… my if code…
} else {
…message that database could not be opened
}
When the code gets to the first line (where dbTemp is set) then a 4060 error(not enough access rights) is raised. But the next line (if (dbTemp != null)) is never reached because this error breaks the code. When the database does not exist then no error is raised and the code continues to the next line where the if statement checks the dbTemp object.
Is there a way in java to catch this particular error, leaves a message (messagebox) and then still continues with the next line?