private void hapusActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_hapusActionPerformed
        try{
            Class.forName ("com.mysql.jdbc.Driver");

            String urldb="jdbc:mysql://localhost:3306/restaurant";
            String user=main.dbUser;
            String password=main.dbPassword;
            Connection koneksi=java.sql.DriverManager.getConnection(urldb,user,password);
            
            Statement st = koneksi.createStatement();

            String strSQL="DELETE FROM `restaurant`.`pegawai` WHERE `pegawai`.`nama` = '"+nama.getText()+"'";
            st.executeUpdate(strSQL);
            int row = tblpegawai.convertRowIndexToModel(tblpegawai.getSelectedRow());
            tblModel.removeRow(row);

            nama.setText("");
            pswd.setText("");
           
            st.close();
            koneksi.close();
        }catch(ClassNotFoundException cnfe){
            System.out.println("KESALAHAN SAAT"+"ME-LOAD DRIVER JDBC \n"+cnfe.getMessage());
        }catch(SQLException sqle){
            System.out.println("KESALAHAN SAAT KONEKSI ATAU "+"KESALAHAN QUERY SQL \n"+sqle.getMessage());
        }
    }//GEN-LAST:event_hapusActionPerformed