private void empNoKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_empNoKeyReleased
        String empNum = empNo.getText();
        ResultSet rs = null;

        if(empNum.matches("\\d{7}")){
            try{
                String sql = "select rowid from Employee where empNo = '" + empNum + "'";
                conn = DBConnect.connect();
                pst = conn.prepareStatement(sql);
                rs = pst.executeQuery();
                if(rs.next()){
                    JOptionPane.showMessageDialog(null, "Employee ID No. must be UNIQUE!");
                    empNo.setText("");
                }
            }
            catch(Exception e){
                JOptionPane.showMessageDialog(null, e);
            }
            finally{
                if(pst != null){
                    try{
                        pst.close();
                    }
                    catch(SQLException ex){
                        JOptionPane.showMessageDialog(null, ex);
                    }
                }
                if(rs != null){
                    try{
                        rs.close();
                    }
                    catch(SQLException ex){
                        JOptionPane.showMessageDialog(null, ex);
                    }
                }
                if(conn != null){
                    try{
                        conn.close();
                    }
                    catch(SQLException ex){
                        JOptionPane.showMessageDialog(null, ex);
                    }
                }
            }
        }
    }