Saturday 23 July 2011

How to update Record in database

   Connection con=null;
        Statement smt=null;
        con=(Connection)Fun.Connect();//its function to make in other class
      
        
        try {
                smt=con.createStatement();
               
                smt.executeUpdate(" DELETE FROM APP.SYSACC  WHERE COERID ='"+jTextFieldCoerId.getText()+"'");
               
                smt.close();
                con.close();
               JOptionPane.showMessageDialog(this,"You Sucessfully Delete the Account");
                jButtonClear.doClick();
            }
        catch(SQLException ex)
        {
        Fun.DiloagboxError(ex.getMessage());
       
        }

No comments:

Post a Comment