authorRS = stmt.executeQuery();
authorRS = authorStmt.executeQuery();
  private void commentList(Integer userId, PreparedStatement stmt, Connection conn, ServletPrinter sp)  {    ResultSet rs = null;    String date, comment;    int authorId;    try    {      conn.setAutoCommit(false); // faster if made inside a Tx      // Try to find the comment corresponding to the user      try      {        stmt =          conn.prepareStatement("SELECT * FROM comments WHERE to_user_id=?");        stmt.setInt(1, userId.intValue());        rs = stmt.executeQuery();      }      catch (Exception e)      {        sp.printHTML("Failed to execute Query for list of comments: " + e);        conn.rollback();        closeConnection(stmt, conn);        return;      }      if (!rs.first())      {        sp.printHTML("<h3>There is no comment yet for this user.</h3><br>");        conn.commit();        closeConnection(stmt, conn);        return;      }      sp.printHTML("<br><hr><br><h3>Comments for this user</h3><br>");      sp.printCommentHeader();      // Display each comment and the name of its author      do      {        comment = rs.getString("comment");        date = rs.getString("date");        authorId = rs.getInt("from_user_id");        String authorName = "none";        ResultSet authorRS = null;        PreparedStatement authorStmt = null;        try        {          authorStmt = conn.prepareStatement("SELECT nickname FROM users WHERE id=?");          authorStmt.setInt(1, authorId);          authorRS = stmt.executeQuery();          if (authorRS.first())            authorName = authorRS.getString("nickname");          authorStmt.close();        }        catch (Exception e)        {          sp.printHTML("Failed to execute Query for the comment author: " + e);          conn.rollback();          authorStmt.close();          closeConnection(stmt, conn);          return;        }        sp.printComment(authorName, authorId, date, comment);      }      while (rs.next());      sp.printCommentFooter();      conn.commit();    }    catch (Exception e)    {      sp.printHTML("Exception getting comment list: " + e + "<br>");      try      {        conn.rollback();        closeConnection(stmt, conn);      }      catch (Exception se)      {        sp.printHTML("Transaction rollback failed: " + e + "<br>");        closeConnection(stmt, conn);      }    }  }