struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Lamb <>
Subject Re: Struts DB Access :: Best Practices
Date Thu, 10 Mar 2005 18:56:04 GMT
NetSQL wrote:
> Even silly JSF uses RowSet as DTO. (RowSet is realy a ArrayList of 
> HashMaps. Rows of Columns)

What does a ArrayList of HashMaps get you over a java.sql.ResultSet? 
I'll tell you a big disadvantage: it keeps everything in memory. What if 
the result set is large?

> I look at it like this:
> -SQL is a Set oriented lang.(row by row processing is exponentialy slower)

This is totally wrong:

- SQL is a multi-set-oriented language, much to the disgust of many 
relational database users.

- "Exponentially" doesn't mean "a lot". It describes a function that 
asymptotically approaches e^n.

- Putting all the data into another container _is_ row-by-row 
processing. You're always doing row-by-row processing, even just to 
fetch it from the database server. And once you've put it in whatever 
form you want, you still have to do row-by-row processing, or you've 
wasted your time fetching a lot of useless rows.


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

View raw message