Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- try{
- Class.forName("java.sql.Driver");
- conn=DriverManager.getConnection("jdbc:mysql://localhost/bellissimo","root"," ");
- int k =JOptionPane.showConfirmDialog(null,"Do you wish to add a new record?");
- if(k==JOptionPane.YES_OPTION){
- st=conn.createStatement();
- String query="Update details set customerid="+idTF.getText()+"customername="+nameTF.getText()+"phoneno="+phnTF.getText()+"address="+adrsTF.getText()+"'where customerid="+idTF.getText()+";";
- st.executeUpdate(query);
- JOptionPane.showMessageDialog(null,"Record Updated");
- }
- catch(Exception x){
- JOptionPane.showMessageDialog(null,x.getMessage());}
- }
Add Comment
Please, Sign In to add comment