Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- List lijst = klantList.getSelectedValuesList();
- String s = lijst.toString();
- String[] split = s.split(" ");
- String factnr = split[0];
- for (Object nieuweLijst : lijst) {
- try{
- Connection con = Week5.getConnection();
- Statement stmt = con.createStatement();
- String SQL = "DELETE FROM lineitem WHERE factuurnr = '"+factnr+"' ";
- int delete = stmt.executeUpdate(SQL);
- String SQL2 = "DELETE FROM factuur WHERE factuurnr = '"+factnr+"' ";
- int delete2 = stmt.executeUpdate(SQL2);
- if(delete == 1 & delete2 == 1){
- JOptionPane.showMessageDialog(null, "De order is verwijderd");
- }else{
- JOptionPane.showMessageDialog(null, "De order is niet verwijderd");
- }
- }catch (SQLException err) {
- JOptionPane.showMessageDialog(rootPane, err);
- }
- }
- updateTable();
Advertisement
Add Comment
Please, Sign In to add comment