public static boolean updateContactUrgence(ContactUrgence contact) throws Exception {

    Connection con;
    ConnexionBd connexionBD = new ConnexionBd();
    boolean updateOk = false;
    con = connexionBD.createConnection();

    try {
      String sqlString =
          "Update contact_urgence "
              + " Set nom = "
              + contact.getNom()
              + ", prenom = "
              + contact.getPrenom()
              + ", courriel = "
              + contact.getCourriel()
              + ", id_relation = "
              + contact.getRelation().getId()
              + " Where id = "
              + contact.getId();

      updateOk = connexionBD.executeSQL(con, sqlString);
      if (!updateOk) {
        System.err.println("***To update the data row ...." + sqlString);
      }
    } catch (SQLException e) {
      System.err.println("***** Database error at updateContactUrgence: " + e.getMessage());
    }

    con.close();
    System.out.println("Connection closed");
    return updateOk;
  }
  public static boolean insertOneContact(ContactUrgence contact) throws Exception {

    Connection con;
    ConnexionBd connexionBD = new ConnexionBd();
    boolean insertOk = false;
    con = connexionBD.createConnection();

    try {
      String sqlString =
          "insert into contact_urgence "
              + "(id, nom, prenom, courriel, id_relation) "
              + "values ("
              + contact.getId()
              + ", '"
              + contact.getNom()
              + "', '"
              + contact.getPrenom()
              + "', '"
              + contact.getCourriel()
              + "', '"
              + contact.getRelation().getId()
              + "')";

      insertOk = connexionBD.executeSQL(con, sqlString);
      if (!insertOk) {
        System.err.println("***To insert the data row ...." + sqlString);
      }
    } catch (SQLException e) {
      System.err.println("***** Database error at insertOneContact: " + e.getMessage());
    }

    con.close();
    System.out.println("Connection closed");
    return insertOk;
  }
  public static ContactUrgence getOneContact(ContactUrgence contact) throws SQLException {
    Connection con;
    Statement stmt = null;
    ResultSet rs = null;
    ContactUrgence temp = new ContactUrgence();
    ConnexionBd connexionBD = new ConnexionBd();
    con = connexionBD.createConnection();

    try {
      stmt = con.createStatement();
      rs =
          stmt.executeQuery(
              "select * from contact_urgence "
                  + "where prenom = '"
                  + contact.getPrenom()
                  + "' and nom  = '"
                  + contact.getNom()
                  + "' and courriel = '"
                  + contact.getCourriel()
                  + "' and id_relation = "
                  + contact.getRelation().getId());
      if (rs.next()) {
        temp = new ContactUrgence();
        temp.setId(rs.getInt("id"));
        temp.setNom(rs.getString("nom"));
        temp.setPrenom(rs.getString("prenom"));
        temp.setCourriel(rs.getString("courriel"));
        int idRelation = rs.getInt("id_relation");
        // Requète pour récupérer la relation
        rs = stmt.executeQuery("select * from relation where id = " + idRelation);
        if (rs.next()) {
          temp.setRelation(new Relation(rs.getInt("id"), rs.getString("nom")));
        }

      } else {
        System.out.println("***** Le contact n'existe pas.");
      }
    } catch (SQLException e) {
      System.err.println("***** Database error at getOneContact: " + e.getMessage());
    } finally {
      if (rs != null) {
        rs.close();
      }
      if (stmt != null) {
        stmt.close();
      }
    }

    con.close();
    System.out.println("Connection closed");
    System.err.println("***** END getOneContact()");
    return temp;
  }