File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Passing a ResultSet from a servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Passing a ResultSet from a servlet" Watch "Passing a ResultSet from a servlet" New topic

Passing a ResultSet from a servlet

Zein Nunna
Ranch Hand

Joined: Mar 31, 2005
Posts: 245

I was just curious, is it possible to send a ResultSet from a Servlet to a JSP? If so how is this done?

Thanks in advance

Ben Souther

Joined: Dec 11, 2004
Posts: 13410

Any java object can be bound to request, session, or context scope and read in a JSP.
People ususally process the resultset in the servlet or bean and pass a lighter, more generic object like a an arrayList or a plain old java array.

JSPs shouldn't need to import any of the java.sql packages.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
I agree. Here's the link:
subject: Passing a ResultSet from a servlet
It's not a secret anymore!