private void editTrainingAttendedActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_editTrainingAttendedActionPerformed
        String trnTitle = trainingTitle.getText();
        String trnDate = ((JTextField)trainingDate.getDateEditor().getUiComponent()).getText();
        String trnPersonnel = trainingPersonnel.getText();
        
        if(!"".equals(trnTitle)){
            String sql = "update EmpTrainingAttended set trainingTitle=?,trainingDate=?,trainingPersonnel=? where empNo=? and trainingTitle=? and trainingDate=? and trainingPersonnel=?";
            try{
                conn = DBConnect.connect();
                pst = conn.prepareStatement(sql);
                pst.setString(1, trnTitle);
                pst.setString(2, trnDate);
                pst.setString(3, trnPersonnel);
                pst.setString(4, empNm);
                pst.setString(5, trTitle);
                pst.setString(6, trDate);
                pst.setString(7, trPersonnel);
                pst.execute();
                
                JOptionPane.showMessageDialog(null, "Command successful!");
                trainingTitle.setText("");
                trainingDate.setDate(null);
                trainingPersonnel.setText("");
                trainingTitle.requestFocus(true);
            }
            catch(Exception e){
                JOptionPane.showMessageDialog(null, e);
            }
            finally{
                if(pst != null){
                     try{
                         pst.close();
                    }
                    catch(SQLException e){

                    }
                }
                if(conn != null){
                     try{
                         conn.close();
                    }
                    catch(SQLException e){

                    }
                }
            }
            initTrainingAttendedTable();
        }
        else{
            JOptionPane.showMessageDialog(null, "Command unsuccessful!\nTraining Title is empty");
        }
    }