System.exit is not needed here. Add a lifetime to the database connection object.