Friday, October 26, 2012

Code used in video "Java prog#16.Deleting Data from an SQLite (MySql) Database in Netbeans java"

Here I am providing the downloadable code link of  the java code I have used in the video
 "Java prog#16.Deleting Data from an SQLite (MySql) Database in Netbeans java"  of my YouTube channel ProgrammingKnowledge

Click Link to watch the video LINK

This code below is for the cmd_deleteActionPerformed  method action perform



 private void cmd_deleteActionPerformed(java.awt.event.ActionEvent evt) {                                           

      String sql="delete from Empoyeeinfo where Empoyeeid =?";
        try{
        
            pst=conn.prepareStatement(sql);
            
            pst.setString(1, txt_Empoyeeid.getText());
            
            pst.execute();
            JOptionPane.showMessageDialog(null, "Deleted");
        
        }catch(Exception e){
        
         JOptionPane.showMessageDialog(null, e);
        
        }
        Update_table();
    }  

1 comment:

  1. Hello! i Need help PLzzzzz.... How to delete images from a Jframe and also by doing that the image will be deleted from the database also??
    the thing i wanna do is-
    By pressing "BROWSE" button i can choose a picture from all the pictures i hav in the database(like we do with File chooser while inserting images).Then after choosing if i click "DELETE" button,that particular image will be deleted.

    ReplyDelete