private void addEmpHistActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addEmpHistActionPerformed
        String pos = position.getText();
        String empl = employer.getText();
        String strt = start.getText();
        String nd = end.getText();
                      
        if(!"".equals(pos) || !"".equals(empl)){
            boolean flag = ifExist(pos,empl,strt,nd);
            if(flag){
                String sql = "insert into EmploymentHistory (empNo,jobTitle,employer,start,end) values (?,?,?,?,?)";
                try{
                    conn = DBConnect.connect();
                    pst = conn.prepareStatement(sql);
                    pst.setString(1, empNm);
                    pst.setString(2, pos);
                    pst.setString(3, empl);
                    pst.setString(4, strt);
                    pst.setString(5, nd);
                    pst.execute();

                    JOptionPane.showMessageDialog(null, "Command successful!");
                    position.setText("");
                    employer.setText("");
                    start.setText("");
                    end.setText("");
                    position.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){

                        }
                    }
                }
                initEmpHistTable();
            }
            else{
                JOptionPane.showMessageDialog(null, "Command unsuccessful!\nValues already exist");
            }
        }
        else{
            JOptionPane.showMessageDialog(null, "Command unsuccessful!\nPosition and Employer input fields are empty");
        }
    }