Example 11-12: ShowQuotes.jsp returning XML using a QueryBean

<?xml version="1.0"?>
<Quotes>
<jsp:useBean id="qb" class="QueryBean"/>
<%@ page contentType="text/xml" %>
<% qb.setQuery("SELECT q.symbol, q.price, q.change"+
               "  FROM quotes q, portfolio_stocks ps"+
               " WHERE q.symbol = ps.symbol "+
               "   AND ps.owner = " + request.getParameter("id")); %>
<% while (qb.next ()) { %>
  <Quote>
    <Symbol><%= qb.column(1) %></Symbol>
    <Price><%=  qb.column(2) %></Price>
    <Change><%= qb.column(3) %></Change>
  </Quote>
<% } qb.close(); %>
</Quotes>