Hello everybody!
I have a JSP-page on which I try to connect to a database (sybase). If an exception is thrwon an error-page is called.
What I now try to do is to set a session-attribute depending
on the sql-exception. But I don't know how to differentiate this. I need to know whether the login-informations (username or password) have been wrong or if the database was unreachable or if the user hasn't got the right to access a certain table.
All I am able to do is to print out the exception with:
<% out.println( exception.toString()); %>
But what I want is something like:
String error = "";
if (exception = <wrong-login-info>){
error = "wrong username or password";
}
else if (exception = <db-offline>){
error = "database seems to be offline";
}
else if (exception = <no-rights>){
error = "no rights for the table";
}
else{
error = "unexpected exception";
}
Any ideas??
Cheers
frag patrick.metz@epost.de
I have a JSP-page on which I try to connect to a database (sybase). If an exception is thrwon an error-page is called.
What I now try to do is to set a session-attribute depending
on the sql-exception. But I don't know how to differentiate this. I need to know whether the login-informations (username or password) have been wrong or if the database was unreachable or if the user hasn't got the right to access a certain table.
All I am able to do is to print out the exception with:
<% out.println( exception.toString()); %>
But what I want is something like:
String error = "";
if (exception = <wrong-login-info>){
error = "wrong username or password";
}
else if (exception = <db-offline>){
error = "database seems to be offline";
}
else if (exception = <no-rights>){
error = "no rights for the table";
}
else{
error = "unexpected exception";
}
Any ideas??
Cheers
frag patrick.metz@epost.de