try { pstmt.close(); } catch (Exception ignore) {}
  public String listComments(Integer userId, Connection conn) throws RemoteException  {    ResultSet rs = null;    PreparedStatement stmt = null;    String date = null, comment = null;    int authorId = -1;    StringBuffer html = null;    // 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();      if (!rs.first())       {        stmt.close();        return printHTMLHighlighted(("<br><h3>There is no comment yet for this user.</h3><br>"));      }      else        html = new StringBuffer(printHTMLHighlighted("<h3>Comments for this user</h3><br>"));    }    catch (Exception e)    {      try { stmt.close(); } catch (Exception ignore) {}      try { conn.close(); } catch (Exception ignore) {}      throw new RemoteException("Failed to execute Query for list of comments: " +e);    }    html.append(printCommentHeader());    try    {    // Display each comment and the name of its author      stmt = conn.prepareStatement("SELECT nickname FROM users WHERE id=?");      ResultSet authorRS = null;      do       {        comment = rs.getString("comment");        date = rs.getString("date");        authorId = rs.getInt("from_user_id");        String authorName = "none";        try        {          stmt.setInt(1, authorId);          authorRS = stmt.executeQuery();          if (authorRS.first())            authorName = authorRS.getString("nickname");        }        catch (Exception e)        {          throw new RemoteException("Failed to execute Query for the comment author: " +e);        }        html.append(printComment(authorName, date, comment, authorId));      }      while (rs.next());      stmt.close();    }    catch (Exception e)    {      try { stmt.close(); } catch (Exception ignore) {}      try { conn.close(); } catch (Exception ignore) {}      throw new RemoteException("Failed to get comments list: " +e);    }    html.append(printCommentFooter());    return html.toString();  }