>Hi all,
>I need help with an apllication.
>I need make a query in an Oracle Table and put the result in a html table.
>How can I pass the resultset from Oracle to JSP?
>Does anybody help-me???

You don't "pass the resultset from Oracle to JSP."

I don't know what kind of architecture you're using, but here's a simple,
incomplete, and quite flawed example:

<!-- ... assume full setup has been done, to the point where the Connection
is in a variable called "conn" -->
<table>
<%
PreparedStatement ps=conn.createPreparedStatement("select * from my_table");
ResultSet rs=ps.executeQuery();
while(rs.next())
{
out.println("<tr><td>"+rs.getString(1)+"</tr></td>");
}
rs.close();
%>
</table>

Voila! Table from a resultset! Lacks all exception handling and error
trapping, uses massive scriptlets, as maintainable as... um... well, it's
not really maintainable.

A better route would be to use EJBs or a MVC approach (where a front end
servlet is responsible for constructing the resultset).
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com

===========================================================================
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://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to