Advertisement
irfanamir

try

Mar 15th, 2021
928
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.74 KB | None | 0 0
  1. try {
  2.             String sql ="UPDATE murid SET nis = '"+nis.getText()+"', nama = '"+nama.getText()+"', jk = '"+jk.getText()+"', alamat = '"+al.getText()+"', kelas = '"+kelas.getText()+"', jurusan = '"+jurusan.getText()+"', agama = '"+agama.getText()+"', ortu = '"+ortu.getText()+"' WHERE nis = '"+nis.getText()+"'";
  3.             java.sql.Connection con=(Connection)Db_Connection.configDB();
  4.             java.sql.PreparedStatement pst=con.prepareStatement(sql);
  5.             pst.execute();
  6.             JOptionPane.showMessageDialog(this, "data berhasil di edit");
  7.         } catch (Exception e) {
  8.             JOptionPane.showMessageDialog(null, "Perubahan Data Gagal"+e.getMessage());
  9.         }
  10.         TampilData();
  11.         kosong();      
  12.     }  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement