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.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *