Re: Newbie: pass ResultSet to JSP?

2002-06-21 Thread hemant


The cached Row set works extremely well for small volumes but when volumes
are large, its can cause a resource problem as these objects hog the memory
especially when there are a large number of users.

just a thought.

later
hemant


- Original Message -
From: "Shekhar Jain" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Friday, June 21, 2002 1:06 PM
Subject: RE: Newbie: pass ResultSet to JSP?


> We've had good success in using a CachedRowSet instead of a ResultSet.
>
> -Original Message-
> From: Struts Newsgroup [mailto:@[EMAIL PROTECTED]]
> Sent: Friday, June 21, 2002 6:25 AM
> To: [EMAIL PROTECTED]
> Subject: Newbie: pass ResultSet to JSP?
>
>
> Subject: Newbie: pass ResultSet to JSP?
> From: "David Chu" <[EMAIL PROTECTED]>
>  ===
> I am trying to get my head around this struts framework for the first
> time. I am confused about the best/standard way to access data from a
> JSP.
>
> - Let's say I want a page list_items.jsp.
> - I have access to a bean that has a method that returns the results of
> a database query as a ResultSet object.
> - How should I iterate through the rows of the bean?
> - Complication: my jsp complains that the ResultSet object has been
> closed (because I closed the query)
>
> Is this the prefered encapsulator of data that I should be accessing
> through my JSP?  Hopefully I can use the  tag.
>
> Thanks for helping out a new struts developer!
>
> -david
>
> --
> David C. Chu
> America Online
> Network Tools Intern
> --
>
>
>
> --
> To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
>
>
>
>
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




RE: Newbie: pass ResultSet to JSP?

2002-06-21 Thread Shekhar Jain

We've had good success in using a CachedRowSet instead of a ResultSet. 

-Original Message-
From: Struts Newsgroup [mailto:@[EMAIL PROTECTED]] 
Sent: Friday, June 21, 2002 6:25 AM
To: [EMAIL PROTECTED]
Subject: Newbie: pass ResultSet to JSP?


Subject: Newbie: pass ResultSet to JSP?
From: "David Chu" <[EMAIL PROTECTED]>
 ===
I am trying to get my head around this struts framework for the first
time. I am confused about the best/standard way to access data from a
JSP.

- Let's say I want a page list_items.jsp.
- I have access to a bean that has a method that returns the results of
a database query as a ResultSet object.
- How should I iterate through the rows of the bean?
- Complication: my jsp complains that the ResultSet object has been
closed (because I closed the query)

Is this the prefered encapsulator of data that I should be accessing
through my JSP?  Hopefully I can use the  tag.

Thanks for helping out a new struts developer!

-david

--
David C. Chu
America Online
Network Tools Intern
--



--
To unsubscribe, e-mail:

For additional commands, e-mail:






--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Newbie: pass ResultSet to JSP?

2002-06-21 Thread Dave Derry

As you found, you cannot pass the ResultSet back to your JSP. This would not
be a good thing if you could. That would be coupling your data layer too
closely with your view layer. A better solution is to populate a Collection
object with the data in your ResultSet, and pass that back to your JSP
(through a controller such as an Action object I assume).

There has also been some discussion about RowSets, but I haven't had a
chance to look into them.

Dave


- Original Message -

> Subject: Newbie: pass ResultSet to JSP?
> From: "David Chu" <[EMAIL PROTECTED]>
>  ===
> I am trying to get my head around this struts framework for the first
time.
> I am confused about the best/standard way to access data from a JSP.
>
> - Let's say I want a page list_items.jsp.
> - I have access to a bean that has a method that returns the results of a
> database query as a ResultSet object.
> - How should I iterate through the rows of the bean?
> - Complication: my jsp complains that the ResultSet object has been closed
> (because I closed the query)
>
> Is this the prefered encapsulator of data that I should be accessing
through
> my JSP?  Hopefully I can use the  tag.
>
> Thanks for helping out a new struts developer!
>
> -david
>
>


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Newbie: pass ResultSet to JSP?

2002-06-21 Thread Joe Germuska

You can definitely use  -- you just shouldn't try to 
iterate the ResultSet.  In a strict MVC/Model 2 approach, the 
ResultSet ("model") should be isolated from the JSP ("view").

In your action, just run through the result set and put the data 
values into a list of instances of some view-level adapter object. 
This lets your page work whether the data comes from a database, an 
XML file, or previously entered user data.

If you don't need anything sophisticated, your adapter could simply 
be a java.util.Map; if you think you're going to use these "views" of 
your data more often, you should make a simple bean.

Hope that helps.

Joe

At 6:25 AM -0700 2002/06/21, Struts Newsgroup (@Basebeans.com) wrote:
>Subject: Newbie: pass ResultSet to JSP?
>From: "David Chu" <[EMAIL PROTECTED]>
>  ===
>I am trying to get my head around this struts framework for the first time.
>I am confused about the best/standard way to access data from a JSP.
>
>- Let's say I want a page list_items.jsp.
>- I have access to a bean that has a method that returns the results of a
>database query as a ResultSet object.
>- How should I iterate through the rows of the bean?
>- Complication: my jsp complains that the ResultSet object has been closed
>(because I closed the query)
>
>Is this the prefered encapsulator of data that I should be accessing through
>my JSP?  Hopefully I can use the  tag.
>
>Thanks for helping out a new struts developer!
>
>-david
>
>--
>David C. Chu
>America Online
>Network Tools Intern
>--
>
>
>
>--
>To unsubscribe, e-mail:   
>For additional commands, e-mail: 


-- 
--
* Joe Germuska{ [EMAIL PROTECTED] }
"It's pitiful, sometimes, if they've got it bad. Their eyes get 
glazed, they go white, their hands tremble As I watch them I 
often feel that a dope peddler is a gentleman compared with the man 
who sells records."
--Sam Goody, 1956
tune in posse radio: 

--
To unsubscribe, e-mail:   
For additional commands, e-mail: