closeConnection();
  public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException  {    int     regionId = -1, userId = -1;    String  username=null, password=null;    sp = new ServletPrinter(response, "BrowseCategories");    sp.printHTMLheader("RUBiS available categories");    username = request.getParameter("nickname");    password = request.getParameter("password");        conn = getConnection();    // Authenticate the user who want to sell items    if ((username != null && username !="") || (password != null && password !=""))    {      Auth auth = new Auth(conn, sp);      userId = auth.authenticate(username, password);      if (userId == -1)      {        sp.printHTML(" You don't have an account on RUBiS!<br>You have to register first.<br>");        sp.printHTMLfooter();	closeConnection();        return ;	      }    }        String value = request.getParameter("region");    if ((value != null) && (!value.equals("")))    {      // get the region ID      try      {        stmt = conn.prepareStatement("SELECT id FROM regions WHERE name=?");        stmt.setString(1, value);        ResultSet rs = stmt.executeQuery();        if (!rs.first())        {          sp.printHTML(" Region "+value+" does not exist in the database!<br>");          closeConnection();          return ;        }        regionId = rs.getInt("id");      }      catch (SQLException e)      {        sp.printHTML("Failed to execute Query for region: " +e);        closeConnection();        return;      }    }    categoryList(regionId, userId);    	    sp.printHTMLfooter();  }