I was wondering how would I be able to show SQL errors generated during update, delete, select * etc in JSF.
Any help would be appreciated.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You have three options:
Let the exception bubble up (either declare your action methods
throws SQLException, or wrap them inRuntimeExceptioncatchtheSQLExceptionand add it as a JSF message, which is more readable. The format is up to you.Don’t show them (best option). These exceptions would confuse the user. Instead, log them (using log4j, commons-logging, or whatever) to a log file, which you will be able to read later. Show only a generic message to the user that something went wrong.