You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ashish Kulkarni <ku...@yahoo.com> on 2002/08/22 16:29:31 UTC

Struts and Large ResultSet

Hi,

Has any one handled lasgre result set using struts, like my sql query returns ablut 100,000 records but i want to show only 20 records per page, and then when the user clicks next, want to show the next 20 ..

 

 


A$HI$H


---------------------------------
Do You Yahoo!?
HotJobs, a Yahoo! service - Search Thousands of New Jobs

Re: Struts and Large ResultSet

Posted by John Owen <jo...@hotmail.com>.
Google builds indexes of information which I guess are updated at given
intervals. These indexes are parsed to produce result sets. Very similar to
a project I was involved in, but on a different scale and application.

----- Original Message -----
From: "Brandon Goodin" <ma...@phase.ws>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Thursday, August 22, 2002 10:55 AM
Subject: RE: Struts and Large ResultSet


> Changing data will happen. I see this kinda thing happen on google. You to
a
> page and then when the results update the page 5 is different than it was
> just a minute ago on the same query. It's kinda the way things are I
think.
> The only way to avoid this is to keep the ResultSet open and updated from
> the database. This is not a very good solution for high traffic sites.
>
> Brandon
>

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Struts and Large ResultSet

Posted by Brandon Goodin <ma...@phase.ws>.
Changing data will happen. I see this kinda thing happen on google. You to a
page and then when the results update the page 5 is different than it was
just a minute ago on the same query. It's kinda the way things are I think.
The only way to avoid this is to keep the ResultSet open and updated from
the database. This is not a very good solution for high traffic sites.

Brandon

-----Original Message-----
From: John Owen [mailto:johnlowen_bham@hotmail.com]
Sent: Thursday, August 22, 2002 9:50 AM
To: Struts Users Mailing List
Subject: Re: Struts and Large ResultSet


I suggested using the ArrayList for providing a read-only view of the
current state of the database. If something changes, your view would remain
constant until you performed another query. If I were to provide
functionality for an item in the ArrayList, such as update, I would make
sure the system retrieved the latest copy of the item in question.

I would not suggest keeping a ResultSet of that size in the user session. ;)
I also would suggest determining if you really need to query 100,000 records
at once. If so, your J2EE container, application server or client machine
has to be able to handle that much information. If you devise cursors using
a row limit (like rowcount, or is it rowid/rownum?) or some clever query
mechanism, you can pull back data in small, but meaningful groups.
Query-specific applications are database-dependent. I could devise something
for Oracle 8.17 using cursors and using the limit functionality, but it
would not apply to mysql and other databases.

----- Original Message -----
From: "Gus Delgado" <gd...@oceanobjects.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Thursday, August 22, 2002 10:17 AM
Subject: Re: Struts and Large ResultSet


> The only problem with returning so much data is that your ArrayList and
> the database can get out of sink if some else updates one of those
records.
>
>
> Ashish Kulkarni wrote:
>
> >Hi
> >do u keep this Object in the user session???
> >if so, how does it affect the perforamce??
> >Ashish
> > John Owen wrote:Irregardless of struts, I would suggest storing the
ResultSet in an object
> >and then maniuplating the bean (for viewing) through an Action class. I
> >typically store data from a ResultSet in an object and put the object
into a
> >collection such as an ArrayList.
> >
> >Hope this helps,
> >
> >John
> >----- Original Message -----
> >From: "Ashish Kulkarni"
> >To: "Struts Users Mailing List"
> >Sent: Thursday, August 22, 2002 9:29 AM
> >Subject: Struts and Large ResultSet
> >
> >
> >
> >
> >>Hi,
> >>
> >>Has any one handled lasgre result set using struts, like my sql query
> >>
> >>
> >returns ablut 100,000 records but i want to show only 20 records per
page,
> >and then when the user clicks next, want to show the next 20 ..
> >
> >
> >>
> >>
> >>
> >>
> >>A$HI$H
> >>
> >>
> >>---------------------------------
> >>Do You Yahoo!?
> >>HotJobs, a Yahoo! service - Search Thousands of New Jobs
> >>
> >>
> >
> >--
> >To unsubscribe, e-mail:
> >For additional commands, e-mail:
> >
> >
> >A$HI$H
> >
> >
> >---------------------------------
> >Do You Yahoo!?
> >HotJobs, a Yahoo! service - Search Thousands of New Jobs
> >
> >
>
>
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>

--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Struts and Large ResultSet

Posted by John Owen <jo...@hotmail.com>.
I suggested using the ArrayList for providing a read-only view of the
current state of the database. If something changes, your view would remain
constant until you performed another query. If I were to provide
functionality for an item in the ArrayList, such as update, I would make
sure the system retrieved the latest copy of the item in question.

I would not suggest keeping a ResultSet of that size in the user session. ;)
I also would suggest determining if you really need to query 100,000 records
at once. If so, your J2EE container, application server or client machine
has to be able to handle that much information. If you devise cursors using
a row limit (like rowcount, or is it rowid/rownum?) or some clever query
mechanism, you can pull back data in small, but meaningful groups.
Query-specific applications are database-dependent. I could devise something
for Oracle 8.17 using cursors and using the limit functionality, but it
would not apply to mysql and other databases.

----- Original Message -----
From: "Gus Delgado" <gd...@oceanobjects.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Thursday, August 22, 2002 10:17 AM
Subject: Re: Struts and Large ResultSet


> The only problem with returning so much data is that your ArrayList and
> the database can get out of sink if some else updates one of those
records.
>
>
> Ashish Kulkarni wrote:
>
> >Hi
> >do u keep this Object in the user session???
> >if so, how does it affect the perforamce??
> >Ashish
> > John Owen wrote:Irregardless of struts, I would suggest storing the
ResultSet in an object
> >and then maniuplating the bean (for viewing) through an Action class. I
> >typically store data from a ResultSet in an object and put the object
into a
> >collection such as an ArrayList.
> >
> >Hope this helps,
> >
> >John
> >----- Original Message -----
> >From: "Ashish Kulkarni"
> >To: "Struts Users Mailing List"
> >Sent: Thursday, August 22, 2002 9:29 AM
> >Subject: Struts and Large ResultSet
> >
> >
> >
> >
> >>Hi,
> >>
> >>Has any one handled lasgre result set using struts, like my sql query
> >>
> >>
> >returns ablut 100,000 records but i want to show only 20 records per
page,
> >and then when the user clicks next, want to show the next 20 ..
> >
> >
> >>
> >>
> >>
> >>
> >>A$HI$H
> >>
> >>
> >>---------------------------------
> >>Do You Yahoo!?
> >>HotJobs, a Yahoo! service - Search Thousands of New Jobs
> >>
> >>
> >
> >--
> >To unsubscribe, e-mail:
> >For additional commands, e-mail:
> >
> >
> >A$HI$H
> >
> >
> >---------------------------------
> >Do You Yahoo!?
> >HotJobs, a Yahoo! service - Search Thousands of New Jobs
> >
> >
>
>
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Struts and Large ResultSet

Posted by Gus Delgado <gd...@oceanobjects.com>.
The only problem with returning so much data is that your ArrayList and 
the database can get out of sink if some else updates one of those records.


Ashish Kulkarni wrote:

>Hi
>do u keep this Object in the user session???
>if so, how does it affect the perforamce??
>Ashish
> John Owen wrote:Irregardless of struts, I would suggest storing the ResultSet in an object
>and then maniuplating the bean (for viewing) through an Action class. I
>typically store data from a ResultSet in an object and put the object into a
>collection such as an ArrayList.
>
>Hope this helps,
>
>John
>----- Original Message -----
>From: "Ashish Kulkarni" 
>To: "Struts Users Mailing List" 
>Sent: Thursday, August 22, 2002 9:29 AM
>Subject: Struts and Large ResultSet
>
>
>  
>
>>Hi,
>>
>>Has any one handled lasgre result set using struts, like my sql query
>>    
>>
>returns ablut 100,000 records but i want to show only 20 records per page,
>and then when the user clicks next, want to show the next 20 ..
>  
>
>>
>>
>>
>>
>>A$HI$H
>>
>>
>>---------------------------------
>>Do You Yahoo!?
>>HotJobs, a Yahoo! service - Search Thousands of New Jobs
>>    
>>
>
>--
>To unsubscribe, e-mail: 
>For additional commands, e-mail: 
>
>
>A$HI$H
>
>
>---------------------------------
>Do You Yahoo!?
>HotJobs, a Yahoo! service - Search Thousands of New Jobs
>  
>




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: How to do this in struts

Posted by Ashish Kulkarni <ku...@yahoo.com>.
Hi,
yes i want to some thinglike that, like there is a table showing say 20 rows, and each has a check box, like reading mail, then when the user checks one check box and press info, i must show a info panel where in i get all the data for that name, 
 
 Richard Stevens 
wrote:Ashish Kulkarni wrote:

>Hi,
>
>I have textfield on first page, user enters a name there, then i have to go to database, get all the info about this name and load it on a jsp page, 
>
>how can i do it using struts???
>
>Suppose i will call the Action class which will get the data from database and populate ActionForm, how do i pass it to jsp and display it
>

Hi,

I'm not sure if that is the best way, since I'm new to struts myself but 
I'd create a bean class that can hold the data you get out of your DB. 
Within the Action you call, populate that bean and stick it in your form 
(make sure, you have getters and setters for it). After that forward to 
the jsp. There you can use the property attributes of the struts html 
jsp tags to access the information. Suppose your bean is stored as 
result in the form. property="result.name" would access the member name 
within your bean class.

Did you mean that?

CU,

Richard

> 
>



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


A$HI$H


---------------------------------
Do You Yahoo!?
HotJobs, a Yahoo! service - Search Thousands of New Jobs

Re: How to do this in struts

Posted by Richard Stevens <li...@richardstevens.de>.
Ashish Kulkarni wrote:

>Hi,
>
>I have  textfield on first page, user enters a name there, then i have to go to database, get all the info about this name and load it on a jsp page, 
>
>how can i do it using struts???
>
>Suppose i will call the Action class which will get the data from database and populate ActionForm, how do i pass it to jsp and display it
>

Hi,

I'm not sure if that is the best way, since I'm new to struts myself but 
I'd create a bean class that can hold the data you get out of your DB. 
Within the Action you call, populate that bean and stick it in your form 
(make sure, you have getters and setters for it). After that forward to 
the jsp. There you can use the property attributes of the struts html 
jsp tags to access the information. Suppose your bean is stored as 
result in the form. property="result.name" would access the member name 
within your bean class.

Did you mean that?

CU,

Richard

>  
>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


How to do this in struts

Posted by Ashish Kulkarni <ku...@yahoo.com>.
Hi,

I have  textfield on first page, user enters a name there, then i have to go to database, get all the info about this name and load it on a jsp page, 

how can i do it using struts???

Suppose i will call the Action class which will get the data from database and populate ActionForm, how do i pass it to jsp and display it

Ashish


A$HI$H


---------------------------------
Do You Yahoo!?
HotJobs, a Yahoo! service - Search Thousands of New Jobs

Re: Struts and Large ResultSet

Posted by John Owen <jo...@hotmail.com>.
I think I am about to spam the list a few times with this message.

My apologies.
----- Original Message -----
From: "John Owen" <jo...@hotmail.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Thursday, August 22, 2002 10:55 AM
Subject: Re: Struts and Large ResultSet


> Main Entry: ir-re-gard-less
> Pronunciation: "ir-i-'gärd-l&s
> Function: adverb
> Etymology: probably blend of irrespective and regardless
> Date: circa 1912
> nonstandard : REGARDLESS
> usage : Irregardless originated in dialectal American speech in the early
> 20th century. Its fairly widespread use in speech called it to the
attention
> of usage commentators as early as 1927. The most frequently repeated
remark
> about it is that "there is no such word." There is such a word, however.
It
> is still used primarily in speech, although it can be found from time to
> time in edited prose. Its reputation has not risen over the years, and it
is
> still a long way from general acceptance. Use regardless instead.
>
> It's a word, you just are one of those that hasn't generally accepted it.
;)
>
> ----- Original Message -----
> From: "Brandon Goodin" <ma...@phase.ws>
> To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> Sent: Thursday, August 22, 2002 10:26 AM
> Subject: RE: Struts and Large ResultSet
>
>
> > Just an observation. "Irregardless" is not a word. Regardless is already
> > negative. :-) But, I beg you, please don't grade my grammar.
> >
> > Is it friday yet?
> >
> > Brandon
> >
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Struts and Large ResultSet

Posted by Brandon Goodin <ma...@phase.ws>.
LOL! I stand corrected.

Lowly,
Brandon

-----Original Message-----
From: John Owen [mailto:johnlowen_bham@hotmail.com]
Sent: Thursday, August 22, 2002 9:55 AM
To: Struts Users Mailing List
Subject: Re: Struts and Large ResultSet


Main Entry: ir-re-gard-less
Pronunciation: "ir-i-'gärd-l&s
Function: adverb
Etymology: probably blend of irrespective and regardless
Date: circa 1912
nonstandard : REGARDLESS
usage : Irregardless originated in dialectal American speech in the early
20th century. Its fairly widespread use in speech called it to the attention
of usage commentators as early as 1927. The most frequently repeated remark
about it is that "there is no such word." There is such a word, however. It
is still used primarily in speech, although it can be found from time to
time in edited prose. Its reputation has not risen over the years, and it is
still a long way from general acceptance. Use regardless instead.

It's a word, you just are one of those that hasn't generally accepted it. ;)

----- Original Message -----
From: "Brandon Goodin" <ma...@phase.ws>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Thursday, August 22, 2002 10:26 AM
Subject: RE: Struts and Large ResultSet


> Just an observation. "Irregardless" is not a word. Regardless is already
> negative. :-) But, I beg you, please don't grade my grammar.
>
> Is it friday yet?
>
> Brandon
>

--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Struts and Large ResultSet

Posted by John Owen <jo...@hotmail.com>.
Main Entry: ir-re-gard-less
Pronunciation: "ir-i-'gärd-l&s
Function: adverb
Etymology: probably blend of irrespective and regardless
Date: circa 1912
nonstandard : REGARDLESS
usage : Irregardless originated in dialectal American speech in the early
20th century. Its fairly widespread use in speech called it to the attention
of usage commentators as early as 1927. The most frequently repeated remark
about it is that "there is no such word." There is such a word, however. It
is still used primarily in speech, although it can be found from time to
time in edited prose. Its reputation has not risen over the years, and it is
still a long way from general acceptance. Use regardless instead.

It's a word, you just are one of those that hasn't generally accepted it. ;)

----- Original Message -----
From: "Brandon Goodin" <ma...@phase.ws>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Thursday, August 22, 2002 10:26 AM
Subject: RE: Struts and Large ResultSet


> Just an observation. "Irregardless" is not a word. Regardless is already
> negative. :-) But, I beg you, please don't grade my grammar.
>
> Is it friday yet?
>
> Brandon
>

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Struts and Large ResultSet

Posted by Brandon Goodin <ma...@phase.ws>.
Just an observation. "Irregardless" is not a word. Regardless is already
negative. :-) But, I beg you, please don't grade my grammar.

Is it friday yet?

Brandon

-----Original Message-----
From: Ashish Kulkarni [mailto:kulkarni_ash1312@yahoo.com]
Sent: Thursday, August 22, 2002 9:18 AM
To: Struts Users Mailing List
Subject: Re: Struts and Large ResultSet



Hi
do u keep this Object in the user session???
if so, how does it affect the perforamce??
Ashish
 John Owen wrote:Irregardless of struts, I would suggest storing the
ResultSet in an object
and then maniuplating the bean (for viewing) through an Action class. I
typically store data from a ResultSet in an object and put the object into a
collection such as an ArrayList.

Hope this helps,

John
----- Original Message -----
From: "Ashish Kulkarni"
To: "Struts Users Mailing List"
Sent: Thursday, August 22, 2002 9:29 AM
Subject: Struts and Large ResultSet


>
> Hi,
>
> Has any one handled lasgre result set using struts, like my sql query
returns ablut 100,000 records but i want to show only 20 records per page,
and then when the user clicks next, want to show the next 20 ..
>
>
>
>
>
>
> A$HI$H
>
>
> ---------------------------------
> Do You Yahoo!?
> HotJobs, a Yahoo! service - Search Thousands of New Jobs

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


A$HI$H


---------------------------------
Do You Yahoo!?
HotJobs, a Yahoo! service - Search Thousands of New Jobs


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Struts and Large ResultSet

Posted by Ashish Kulkarni <ku...@yahoo.com>.
Hi
do u keep this Object in the user session???
if so, how does it affect the perforamce??
Ashish
 John Owen wrote:Irregardless of struts, I would suggest storing the ResultSet in an object
and then maniuplating the bean (for viewing) through an Action class. I
typically store data from a ResultSet in an object and put the object into a
collection such as an ArrayList.

Hope this helps,

John
----- Original Message -----
From: "Ashish Kulkarni" 
To: "Struts Users Mailing List" 
Sent: Thursday, August 22, 2002 9:29 AM
Subject: Struts and Large ResultSet


>
> Hi,
>
> Has any one handled lasgre result set using struts, like my sql query
returns ablut 100,000 records but i want to show only 20 records per page,
and then when the user clicks next, want to show the next 20 ..
>
>
>
>
>
>
> A$HI$H
>
>
> ---------------------------------
> Do You Yahoo!?
> HotJobs, a Yahoo! service - Search Thousands of New Jobs

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


A$HI$H


---------------------------------
Do You Yahoo!?
HotJobs, a Yahoo! service - Search Thousands of New Jobs

Re: Struts and Large ResultSet

Posted by John Owen <jo...@hotmail.com>.
Irregardless of struts, I would suggest storing the ResultSet in an object
and then maniuplating the bean (for viewing) through an Action class. I
typically store data from a ResultSet in an object and put the object into a
collection such as an ArrayList.

Hope this helps,

John
----- Original Message -----
From: "Ashish Kulkarni" <ku...@yahoo.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Thursday, August 22, 2002 9:29 AM
Subject: Struts and Large ResultSet


>
> Hi,
>
> Has any one handled lasgre result set using struts, like my sql query
returns ablut 100,000 records but i want to show only 20 records per page,
and then when the user clicks next, want to show the next 20 ..
>
>
>
>
>
>
> A$HI$H
>
>
> ---------------------------------
> Do You Yahoo!?
> HotJobs, a Yahoo! service - Search Thousands of New Jobs

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>