This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes JSP and the fly likes How can I access the ResultSet without ScriptLet mixed in the JSP? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » JSP
Reply Bookmark "How can I access the ResultSet without ScriptLet mixed in the JSP?" Watch "How can I access the ResultSet without ScriptLet mixed in the JSP?" New topic
Author

How can I access the ResultSet without ScriptLet mixed in the JSP?

Wei Geng
Greenhorn

Joined: Dec 10, 2004
Posts: 28
I got a java.sql.ResultSet instance when I executed a query statement in the Servlet. I want to transfer the ResultSet instance to the JSP page to display the query result without ScrpitLet mixed into the JSP page.

It seems that it is a better way to convert the ResultSet instance to a javax.servlet.jsp.jstl.sql.Result object and access the Result object in a <c:forEach>.How can I realize the convertion?

If it cannot be realized, is there any way by which JSP page could access ResultSet object without ScriptLet.

Please introduce the involved methods or patterns.
Thanks!
Paul Strachan
Greenhorn

Joined: Oct 24, 2004
Posts: 10
you cant use a result set with jstl because ResultSet does not follow java bean convention for getter method - better to populate a collection of java bean from the original result set. this also has advantage so you can close your ResultSet, Statement and Connection to free resources earlier.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: How can I access the ResultSet without ScriptLet mixed in the JSP?
 
Similar Threads
Can i get a clone of Resultset
How can I access the ResultSet without ScriptLet mixed in the JSP?
how can i acces database using jsp?
Retrieving and displaying ResultSet in JSP
code or server problem ?