closeConnection(conn);
  public void doPost(HttpServletRequest request, HttpServletResponse response)    throws IOException, ServletException  {    String password = null, username = null;    Integer userId = null;    ResultSet rs = null;    PreparedStatement stmt = null;    Connection conn = null;    ServletPrinter sp = null;    sp = new ServletPrinter(response, "About me");    username = request.getParameter("nickname");    password = request.getParameter("password");    conn = getConnection();    // Authenticate the user    if ((username != null && username != "")      || (password != null && password != ""))    {      Auth auth = new Auth(conn, sp);      int id = auth.authenticate(username, password);      if (id == -1)      {        printError("You don't have an account on RUBiS!<br>You have to register first.<br>", sp);        return;      }      userId = new Integer(id);    }    else    {      printError(" You must provide valid username and password.", sp);      return;    }    // Try to find the user corresponding to the userId    try    {      stmt = conn.prepareStatement("SELECT * FROM users WHERE id=?");      stmt.setInt(1, userId.intValue());      rs = stmt.executeQuery();    }    catch (Exception e)    {      sp.printHTML("Failed to execute Query for user: " + e);      closeConnection(stmt, conn);      sp.printHTMLfooter();      return;    }    try    {      if (!rs.first())      {        sp.printHTML("<h2>This user does not exist!</h2>");        closeConnection(stmt, conn);        sp.printHTMLfooter();        return;      }      String firstname = rs.getString("firstname");      String lastname = rs.getString("lastname");      String nickname = rs.getString("nickname");      String email = rs.getString("email");      String date = rs.getString("creation_date");      int rating = rs.getInt("rating");      stmt.close();      String result = new String();      result = result + "<h2>Information about " + nickname + "<br></h2>";      result =        result + "Real life name : " + firstname + " " + lastname + "<br>";      result = result + "Email address  : " + email + "<br>";      result = result + "User since     : " + date + "<br>";      result = result + "Current rating : <b>" + rating + "</b><br>";      sp.printHTMLheader("RUBiS: About " + nickname);      sp.printHTML(result);    }    catch (SQLException s)    {      sp.printHTML("Failed to get general information about the user: " + s);      closeConnection(stmt, conn);      sp.printHTMLfooter();      return;    }    listBids(userId, username, password, stmt, conn, sp);    listItem(userId, conn, sp);    listWonItems(userId, stmt, conn, sp);    listBoughtItems(userId, stmt, conn, sp);    listComment(userId, stmt, conn, sp);    sp.printHTMLfooter();    closeConnection(stmt, conn);  }