public void pasEvenementAan(Evenement e) throws ParseException { String naam = e.getNaam(); String subTitel = e.getSubtitel(); int locatieID = e.getLocatieID(); String contactPersoon = e.getContactPersoon(); String organisator = e.getOrganisator(); String query = "UPDATE event SET naam='" + naam + "', subtitel='" + subTitel + "',datum='" + e.getDatum() + "', locatieid=" + locatieID + " , contactpersoon='" + contactPersoon + "', organisator='" + organisator + "' where eventID='" + e.getEventID() + "'"; System.out.println("Query is ***********************" + query); try { super.addUpdateRecord(query); super.closeConnectRst(); } catch (Exception ex) { System.out.println(ex + "het aanpassen van een evenement is mislukt"); } }
public Evenement getEvent(String id) { Evenement e = new Evenement("", "", "", null, 0, 0, "", "", "", false, null); try { super.makeConnection(); ResultSet rs = super.makeResultSet("SELECT * FROM event WHERE eventID= '" + id + "'"); while (rs.next()) { e.setEventID(id); e.setNaam(rs.getString("naam")); e.setSubtitel(rs.getString("subtitel")); e.setDatum(rs.getDate("datum")); e.setLocatieID(rs.getInt("locatieID")); e.setProgrammaID(rs.getInt("programmaID")); e.setContactPersoon(rs.getString("contactpersoon")); e.setOrganisator(rs.getString("organisator")); e.setType(rs.getString("type")); e.setRemoved(rs.getBoolean("removed")); } super.closeConnectRst(); return e; } catch (SQLException ex) { super.closeConnectRst(); System.out.println(e + "het ophalen van alle evenementen is mislukt"); return e; } }