title: Java method in class cannot be applied to given types
body: <p>I am trying to call a method named <code>searchitem</code> in class <code>Query</code> to a jbutton named Search which will search all details in table item in the database and display them in jtextfields. Below is the <code>searchitem</code> method in class Query.</p>
  
  <pre><code>public ResultSet searchitem() {
      try {
          String sql = "select * from tblitem";
          stmt = conn.connect.createStatement();
          rs = stmt.executeQuery(sql);
          return rs;
      } catch (SQLException ex) {
          System.out.println("SQL Exception in Seach Book "+ex.getMessage());
          JOptionPane.showMessageDialog(null, "Error in Retriving Book Information", "Error", JOptionPane.ERROR_MESSAGE);
          Logger.getLogger(Query.class.getName()).log(Level.SEVERE, null, ex);
          return null;
      }
  }
  </code></pre>
  
  <p>This is the to do code in the jbutton.</p>
  
  <pre><code>try {
  
          String id, nme,cos,pr,available,sid,search;
  
         search= stf1.getText();
  
          if(search.length()!=5 || !search.toLowerCase().startsWith("i")){
              JOptionPane.showMessageDialog(null, "Incorrect Item ID \nItem ID should start with 'i' and 5 characters should be used ", "Error", WIDTH);
          }
  
  
          else{
              Query query = new Query();
              rs = query. searchitem(search);
              rs.next();
  
              id = rs.getString(1);
              nme= rs.getString(2);
              cos = rs.getString(3);
              pr = rs.getString(4);
              available = rs.getString(5);
              sid = rs.getString(6);
  
             boolean availablity = Boolean.valueOf(available);
  
              etf1.setText(id);
              etf2.setText(nme);
              etf3.setText(cos);
              etf4.setText(pr);
              ecb1.setSelected(availablity);
              etf5.setText(sid);
          }
  
            } catch (SQLException ex) {
          JOptionPane.showMessageDialog(null, "Item not Available. \nEnter an existing Item ID", "Unavailable", JOptionPane.ERROR_MESSAGE);
          System.out.println("SQL Exception in retriving Item details");
          Logger.getLogger(Item.class.getName()).log(Level.SEVERE, null, ex);
      }
  }                                        
  </code></pre>
  
  <p>But i get an error in line <code>rs = query. searchitem(search);</code> saying   </p>
  
  <p>method searchitem in class Query cannot be applied to given types;<br>
    required: no arguments<br>
    found: String<br>
    reason: actual and formal argument lists differ in length  </p>