title: Error while updating table [No value specified for parameter 3]
body: <p>Am using struts 1.3.8 framework in netbeans 6.9 and I want to update a value in the database by using <code>preparedStatement</code>. It keeps giving mew an error that ( No value specified for parameter 3) and I don't know what is that parameter cause am setting a value by defining the id. I am appreciating your hard work and hope you help me with that.</p>
  
  <p>This is my code:</p>
  
  <pre><code>try{
      // update the item Qyt in the item table after checking it out
      PreparedStatement ps2 = (PreparedStatement) con.prepareStatement("UPDATE item SET itemQyt=? WHERE itemID=?"
               + " VALUES (?,?)");
      ps2.setInt(1, newQuantity);
      ps2.setInt(2, itemID);
      int updateRows = ps2.executeUpdate();
      ps2.close();
  
  } catch (Exception e) {
      errors.add("SQLUpdatingItem", new ActionMessage("errors.SQLUpdatingItem"));
      System.out.println("ERROR Updating : Did not Update the itemQyt in the item table which the itemId is : " + itemID + " and the new Qyt is :" + newQuantity + " " + e);
  }
  </code></pre>
  
  <p>and this is the error msg:</p>
  
  <blockquote>
    <p>ERROR Updating : Did not Update the itemQyt in the item table which
    the itemId is : 7 and the new Qyt is :9 java.sql.SQLException: No
    value specified for parameter 3</p>
  </blockquote>