When designing an application that connects to a database, how should SQL exceptions be managed to provide meaningful feedback to the user?
- Display the raw SQL exception message
- Log the exception and display a user-friendly error message
- Show a generic error message to the user
- Terminate the application on exception
To provide meaningful feedback, log the SQL exception for debugging purposes and display a user-friendly error message to the user, avoiding the display of raw SQL exception messages that may expose sensitive information.
Loading...
Related Quiz
- What are the implications of using optimistic vs. pessimistic locking strategies in database transactions?
- How does the HttpSessionActivationListener interface help in servlets?
- What is the primary purpose of the try-catch block in a servlet?
- The scope of ServletContext is:
- How does the 'String Pool' in Java affect memory management?