Maybe better verify connection.isValid() and let the driver decide how to do it?