Skip to lesson

Mini project: leak-free ShopLite with clear errors

A robust app treats a database error as one failed action, not the end of the program: every query closes what it opens, every SQLException becomes a clear application exception, and the menu shows the user what to do next.

What you will learn

What you will learn

  • Refactor JDBC code to try-with-resources
  • Build and use a DataAccessException hierarchy
  • Keep a console app running after database errors
  • Prove an application has no connection leaks

Sign in to continue this lesson

Create an account to read every lesson, practise with the exercises and keep track of your progress.