title: Column not found error message in java swing
body: <p>These are my codes inside the .entity directory.</p>
  
  <pre><code>    public boolean createUser() {
      boolean success = false;
      DBController db = new DBController();
      db.setUp("IT Innovation Project");
      String sql = "INSERT INTO forumUsers(users_userName,users_password,users_NRIC)";
      sql += "VALUES ('" + userName + "','" + pwd + "','" + nric + "')";
      System.out.println(sql);
      if (db.updateRequest(sql) == 1)
          success = true;
      db.terminate();
      return success;
  }
  
      public boolean retrieveUser() {
      boolean success = false;
      ResultSet rs = null;
      DBController db = new DBController();
      db.setUp("IT Innovation Project");
      String dbQuery = "SELECT * FROM forumUsers WHERE users_userName = '";
      dbQuery += userName + "'";
      rs = db.readRequest(dbQuery);
      try {
          if (rs.next()) {
              pwd = rs.getString("password");
              success = true;
          }
      } catch (Exception e) {
          e.printStackTrace();
      }
      db.terminate();
      return success;
  }
  </code></pre>
  
  <p>These are my codes in the user interface class.</p>
  
  <pre><code>    if (userName.equals("")||pwd.equals("")||nric.equals(""))
          JOptionPane.showMessageDialog(null,"Please enter all text field");
      else{
          eForumUser user = new eForumUser (userName,pwd,nric);
          if (user.retrieveUser())
                  JOptionPane.showMessageDialog(null,"User already exists! Cannot create.");
          else{
              if (user.createUser()==true);
              JOptionPane.showMessageDialog(null,"User record created successfull!");
          }
  </code></pre>
  
  <p>My database table got users_userName, users_password, users_NRIC, users_securityQuestion, users_answer column. </p>
  
  <p>I can create a data into the database. However, when I try to check whether the username is exist or not by using the retrieveUser method, the console showed me "column not found" error message. So what am I supposed to do to fix this problem? Is it something wrong with my retrieveUser method?</p>
  
  <p>I editted my retriveUser method to:</p>
  
  <pre><code>    public boolean retrieveUser() {
      boolean success = false;
      ResultSet rs = null;
      DBController db = new DBController();
      db.setUp("IT Innovation Project");
      String dbQuery = "SELECT * FROM forumUsers WHERE users_NRIC AND users_securityQuestion AND users_answer = '";
      dbQuery += userName + securityQuestion + answer + "'";
      rs = db.readRequest(dbQuery);
      try {
          if (rs.next()) {
              pwd = rs.getString("users_password");
              success = true;
          }
      } catch (Exception e) {
          e.printStackTrace();
      }
      db.terminate();
      return success;
  }
  </code></pre>
  
  <p>And I try to retrieve password by entering nric, security question and answer. Here is the code for user interface.</p>
  
  <pre><code>    public void submitForgotPwd(ActionEvent e){
      String nric = jTextField.getText();
      Object securityQuestion = jComboBox.getSelectedItem();
      String answer = jTextField1.getText();
      if (nric.equals("")||securityQuestion.equals("")||answer.equals("")){
          JOptionPane.showMessageDialog(null, "Please enter nric,security question and answer.");
      }else{
          eForumUser user = new eForumUser(nric,securityQuestion,answer);
          if (user.retrieveUser()==true){
          jTextField2.setText(user.getPwd());
          }else{
              JOptionPane.showMessageDialog(null,"Nric do not exist or wrong security question and answer");
          }
      }
  }
  </code></pre>
  
  <p>However, my retrieve does not works. Can somebody help me with it? </p>