stmt2 = conn.prepareStatement("UPDATE " + comment_table
stmt.close();  stmt = conn.prepareStatement("UPDATE " + comment_table
  public void doGet(HttpServletRequest request, HttpServletResponse response)      throws IOException, ServletException  {    ServletPrinter    sp   = null;    PreparedStatement stmt = null, stmt2 = null;    Connection        conn = null;    String nickname, password, storyId, parent, userIdstring, subject, body;    String comment_table;    int page = 0, nbOfStories = 0, userId;    int updateResult;    sp = new ServletPrinter(response, "StoreComment");    nickname = request.getParameter("nickname");    password = request.getParameter("password");    storyId = request.getParameter("storyId");    parent = request.getParameter("parent");    subject = request.getParameter("subject");    body = request.getParameter("body");    comment_table = request.getParameter("comment_table");    if (nickname == null)    {      nickname = request.getParameter("nickname");    }    if (password == null)    {      password = request.getParameter("password");    }    if (storyId == null)    {      sp.printHTML("StoreComment, You must provide a story identifier!<br>");      return;    }    if (parent == null)    {      sp          .printHTML("StoreComment, You must provide a follow up identifier!<br>");      return;    }    if (subject == null)    {      sp.printHTML("StoreComment, You must provide a comment subject!<br>");      return;    }    if (body == null)    {      sp          .printHTML("StoreComment, <h3>You must provide a comment body!<br></h3>");      return;    }    if (comment_table == null)    {      sp.printHTML("Viewing comment, You must provide a comment table!<br>");      return;    }    sp.printHTMLheader("RUBBoS: Comment submission result");    sp.printHTML("<center><h2>Comment submission result:</h2></center><p>\n");    conn = getConnection();    // Authenticate the user    userIdstring = sp.authenticate(nickname, password, conn);    userId = (Integer.valueOf(userIdstring)).intValue();    if (userId == 0)      sp.printHTML("Comment posted by the 'Anonymous Coward'<br>\n");    else      sp.printHTML("Comment posted by user #" + userId + "<br>\n");    // Add comment to database    try    {      stmt = conn.prepareStatement("INSERT INTO " + comment_table          + " VALUES (NULL, " + userId + ", " + storyId + ", " + parent          + ", 0, 0, NOW(), \"" + subject + "\", \"" + body + "\")");      updateResult = stmt.executeUpdate();      stmt2 = conn.prepareStatement("UPDATE " + comment_table          + " SET childs=childs+1 WHERE id=" + parent);      updateResult = stmt2.executeUpdate();    }    catch (Exception e)    {      sp.printHTML("Exception getting categories: " + e + "<br>");    }    finally    {      closeConnection(stmt, conn);    }    sp.printHTML("Your comment has been successfully stored in the "        + comment_table + " database table<br>\n");    sp.printHTMLfooter();  }