JesuisEva

her

Jan 30th, 2013
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.66 KB | None | 0 0
  1. opslaanbutton
  2.  
  3. String messageTrue = "Speler is toegevoed.";
  4. String messageFalse = "Speler is niet toegevoed.";
  5.  
  6. sql = "INSERT INTO speler (voornaam, achternaam, adres, postcode, woonplaats, telefoonnummer, email_adres, rating)"
  7. + " VALUES ("
  8. + "'" + voornaamVeld.getText() + "', "
  9. + "'" + achternaamVeld.getText() + "', "
  10. + "'" + adresVeld.getText() + "', "
  11. + "'" + postcodeVeld.getText() + "', "
  12. + "'" + woonplaatsVeld.getText() + "', "
  13. + "" + telefoonnrVeld.getText() + ", "
  14. + "'" + emailVeld.getText() + "', "
  15. + "" + ratingVeld.getText() + ");";
  16.  
  17. resultSet.executeUpdate(sql, messageTrue, messageFalse);
  18.  
  19.  
  20. Inschrijfbutton
  21. try {
  22. stmt = getConnection.con.createStatement();
  23. ModelItem selectedItem = (ModelItem) toernooiCombo.getSelectedItem();
  24.  
  25. String betaalStatus;
  26. if (JaButton.isSelected()) {
  27. betaalStatus = "betaald";
  28. } else if (NeeButton.isSelected()) {
  29. betaalStatus = "onbetaaald";
  30. } else {
  31. betaalStatus = "NULL";
  32. }
  33.  
  34. String sql2 = "INSERT INTO inschrijving (idToernooi, idSpeler, betaalStatus)"
  35. + " VALUES ('" + selectedItem.id + "',"
  36. + "'" + speleridVeld.getText() + "',"
  37. + "'" + betaalStatus + "');";
  38. stmt.executeUpdate(sql2);
  39. } catch (SQLException err) {
  40. JOptionPane.showMessageDialog(null, err.getMessage());
  41. }
  42.  
  43. this.dispose();
Advertisement
Add Comment
Please, Sign In to add comment