+ "\", \"" + qty
  public void doPost(HttpServletRequest request, HttpServletResponse response)    throws IOException, ServletException  {    Integer userId; // item id    Integer itemId; // user id    float minBid; // minimum acceptable bid for this item    float bid; // user bid    float maxBid; // maximum bid the user wants    int maxQty; // maximum quantity available for this item    int qty; // quantity asked by the user    sp = new ServletPrinter(response, "StoreBid");    /* Get and check all parameters */    String value = request.getParameter("userId");    if ((value == null) || (value.equals("")))    {      printError("<h3>You must provide a user identifier !<br></h3>");      return;    }    else      userId = new Integer(value);    value = request.getParameter("itemId");    if ((value == null) || (value.equals("")))    {      printError("<h3>You must provide an item identifier !<br></h3>");      return;    }    else      itemId = new Integer(value);    value = request.getParameter("minBid");    if ((value == null) || (value.equals("")))    {      printError("<h3>You must provide a minimum bid !<br></h3>");      return;    }    else    {      Float foo = new Float(value);      minBid = foo.floatValue();    }    value = request.getParameter("bid");    if ((value == null) || (value.equals("")))    {      printError("<h3>You must provide a bid !<br></h3>");      return;    }    else    {      Float foo = new Float(value);      bid = foo.floatValue();    }    value = request.getParameter("maxBid");    if ((value == null) || (value.equals("")))    {      printError("<h3>You must provide a maximum bid !<br></h3>");      return;    }    else    {      Float foo = new Float(value);      maxBid = foo.floatValue();    }    value = request.getParameter("maxQty");    if ((value == null) || (value.equals("")))    {      printError("<h3>You must provide a maximum quantity !<br></h3>");      return;    }    else    {      Integer foo = new Integer(value);      maxQty = foo.intValue();    }    value = request.getParameter("qty");    if ((value == null) || (value.equals("")))    {      printError("<h3>You must provide a quantity !<br></h3>");      return;    }    else    {      Integer foo = new Integer(value);      qty = foo.intValue();    }    /* Check for invalid values */    if (qty > maxQty)    {      printError(        "<h3>You cannot request "          + qty          + " items because only "          + maxQty          + " are proposed !<br></h3>");      return;    }    if (bid < minBid)    {      printError(        "<h3>Your bid of $"          + bid          + " is not acceptable because it is below the $"          + minBid          + " minimum bid !<br></h3>");      return;    }    if (maxBid < minBid)    {      printError(        "<h3>Your maximum bid of $"          + maxBid          + " is not acceptable because it is below the $"          + minBid          + " minimum bid !<br></h3>");      return;    }    if (maxBid < bid)    {      printError(        "<h3>Your maximum bid of $"          + maxBid          + " is not acceptable because it is below your current bid of $"          + bid          + " !<br></h3>");      return;    }    try    {      conn = getConnection();      conn.setAutoCommit(false);      String now = TimeManagement.currentDateToString();      stmt =        conn.prepareStatement(          "INSERT INTO bids VALUES (NULL, \""            + userId            + "\", \""            + itemId            + "\", \""            + bid            + "\", \""            + maxBid            + "\", \""            + qty            + "\", \""            + now            + "\")");      stmt.executeUpdate();      // update the number of bids and the max bid for the item      try      {        stmt =          conn.prepareStatement(            "SELECT nb_of_bids, max_bid FROM items WHERE id=?");        stmt.setInt(1, itemId.intValue());        ResultSet rs = stmt.executeQuery();        if (rs.first())        {          PreparedStatement update = null;          int nbOfBids = rs.getInt("nb_of_bids");          nbOfBids++;          float oldMaxBid = rs.getFloat("max_bid");          if (bid > oldMaxBid)          {            oldMaxBid = bid;            update =              conn.prepareStatement(                "UPDATE items SET max_bid=?, nb_of_bids=? WHERE id=?");            update.setFloat(1, maxBid);            update.setInt(2, nbOfBids);            update.setInt(3, itemId.intValue());            update.executeUpdate();          }          else          {            update =              conn.prepareStatement("UPDATE items SET nb_of_bids=? WHERE id=?");            update.setInt(1, nbOfBids);            update.setInt(2, itemId.intValue());            update.executeUpdate();          }        }        else        {          conn.rollback();          printError("Couldn't find the item.");          return;        }      }      catch (Exception ex)      {        conn.rollback();        printError("Failed to update nb of bids and max bid: " + ex);        return;      }      sp.printHTMLheader("RUBiS: Bidding result");      sp.printHTML(        "<center><h2>Your bid has been successfully processed.</h2></center>\n");      conn.commit();      closeConnection();    }    catch (Exception e)    {      sp.printHTML(        "Error while storing the bid (got exception: " + e + ")<br>");      try      {        conn.rollback();        closeConnection();      }      catch (Exception se)      {        printError("Transaction rollback failed: " + e);      }      return;    }    sp.printHTMLfooter();  }