struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vic Cekvenich <vic_cekven...@baseBeans.com>
Subject OT: Re: List rows in a table using Beans instead of Recordset
Date Wed, 04 Jun 2003 01:46:52 GMT
This is OT for a frame  work, consider posting JDBC questions on 
comp.lang.java.databases or SQL SIGs, but...

Most people that use framework like Struts, use a DAO (like iBatis ... 
or Hibreante) and do not code at ResultSet level, else we would be using 
a servlet and not a framework.
Struts provides nothing for a DAO, a very nice feature, so you can pick 
anything you like (but picking nothing is not ideal). Look at above 2 
for starters.

For offsetting I use SELECT .... LIMIT 10 OFFSET 1, using a SQL command 
at the DAO level. From Struts you just want to track which OFFSET to 
pass to DAO.
(Yes, most DAOs do caching and flushing automatically). Also OT, using 
cursors is a bad SQL practice, but any SQL list will tell you that.

hth,

.V

Johannes Tyve wrote:

>Hi
>
>I'm new to Struts and would like some directions.
>
>I'm used to servlets, jsp, scriplets with recordset eg. 
>ResultSet rs = stmt.executeQuerY("....");
>while( rs.next() )
> { %>
>        <%= rs.getString("...") %>
><%}
>
>Now I store my data in a bean (loaded from a row in the database) and it 
>works fine when I load, store and update one single row but how do I do 
>when I have a list of rows?
>I could load all my rows into a collection of beans but what if there are 
>millions of rows? Using a recordset I can limit my selection to 10 records 
>at a time and then move my database cursor forward or reverse to show the 
>next /prev 10 records. How is this performed using Struts and beans?
>
>Regards,
>Johannes
>  
>

-- 
Vic Cekvenich,
Struts Instructor,
1-800-917-JAVA

Advanced <a href ="baseBeans.com">Struts Training</a> and project recovery in
North East.
Open Source <a href ="baseBeans.com">Content Management</a>  basicPortal sofware
Best practice<a href ="baseBeans.com">Struts Support</a> v.1.1 helper ScafflodingXPress




---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message