Chris is right, according to your example.  And note that your second query
actually executes once for *each row* that gets returned in the first
query--so if your first query has more than a few rows, you're incurring a
huge amount of overhead.  So, first of all, try to use a join or subquery to
do it all in one query.  But if that doesn't work, you should at least be
using PreparedStatement instead of Statement.

And as for whether you can open two MySQL connections within the same page,
there should be no reason why you couldn't.

-jmc

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to