- Open the last NetBeans project
- Add a buttons name it as Update
- Double click on buttons and add following codes
Update
try{ String val1=txtID.getText(); int v1=Integer.parseInt(val1); String val2 =txtName.getText(); String val3=txtAdress.getText(); String sql="update EMPDATA set ID='"+v1+"',NAME='"+val2+"',ADRESS='"+val3+"'"; pst=conn.prepareStatement(sql); pst.execute(); JOptionPane.showMessageDialog(null, "Upadated"); } catch(Exception e){JOptionPane.showMessageDialog(null, e);}
No comments:
Post a Comment