You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Savantraj, Chennamakal Subramanian" <Sa...@ap.sony.com> on 2002/11/20 04:23:32 UTC

About RowSet

Hi,
Could anyone share your experience in using RowSet to Transfer data from
ResultSet?
What is the significance difference using a rowset instead of our custom
generated
collection object or something like TableModel?
What would be a better option for the following situation.

Objective
	1. Create a Custom Tag which will generate a Table HTML Display
based on a Result Set.
Approach 1
	1. Run the SQL
	2. Populate Collection (RowSet/TableModel/Any other) from ResultSet
	3. Pass the collection to Custom Tag
	4. Custom Tag will generate <SELECT><Option></SELECT> based on the
collection.

In the above scenario will I save any processing (Looping) if I use RowSet?
If I am using my own
collection I need to run Loop 1 to create the collection and Loop 2 inside
Custom Tag to generate
HTML. RowSet looks like saving the first loop. But how it is internally
doing? Is it the same way?

Pls provide your advice.

Thanks in advance

Best Regards
Savant
	

-------------------------------------------------------------------
This email is confidential and intended only for the use of the individual
or entity named above and may contain information that is privileged. If you
are not the intended recipient, you are notified that any dissemination,
distribution or copying of this email is strictly prohibited. If you have
received this email in error, please notify us immediately by return email
or telephone and destroy the original message. Thank you. - This mail is
sent via Sony Asia Pacific Mail Gateway. 
-------------------------------------------------------------------


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


Re: About RowSet

Posted by "V. Cekvenich" <vi...@users.sourceforge.net>.
http://www.javaworld.com/javaworld/jw-02-2001/jw-0202-cachedrow.html as 
per google, or you can read the JavaDoc on rowset in Java Developers 
Connection on JavaSoft.com.

You should either use RowSet or Resultset, not sure of why mix.
RowSet extends ResultSet, major difference that former is a bean, that 
is you can say new RowSet(), thus making GC a bit easier for new 
developers who do not do the nested finally right for the ResultSet.

Since you are posting on Struts, I assume you would use existing tags, 
as opposed to writing tags.

There is a source code approach with "zero" copy on basicPortal.sf.net.
A DAO has a ROWSET. (or CommonsSQL - 2 ways)
A Bean has a DAO.
DAO is also an iterator, and Bean is also a Collection(advanced topic: 
even as your treat this bean for testing with bean properties, Struts 
sees it as a collection (iterator adaptor w getRow), so it can do multi 
row updates, for master detail processing).
You unit test the Bean, so it can be used by Console, Model1 use bean, etc.

The benefit of this design is that when a setter is fired by Struts, it 
is on the disconnected RowSet, thus Zero copy.
There are no VO, DTO, etc. objects that are GCed later, thus you can 
support more concurrent users per server.

Not sure what loops or populations you are talking about, but there is a 
rowset DAO w/ Struts on sf.net

Above is for any bean.

For options collection, you can create an collection of beans, with 2 
properties. Again, do not use Resultset for beans, and RowSet for 
options, it makes no sense.

hth,
.V

ot: I will soon have a DAO that also uses Commons SQL so you can chose 
RowSet or CommonSQL (else you write your own DAO, to say JDO)

Savantraj, Chennamakal Subramanian wrote:
> Hi,
> Could anyone share your experience in using RowSet to Transfer data from
> ResultSet?
> What is the significance difference using a rowset instead of our custom
> generated
> collection object or something like TableModel?
> What would be a better option for the following situation.
> 
> Objective
> 	1. Create a Custom Tag which will generate a Table HTML Display
> based on a Result Set.
> Approach 1
> 	1. Run the SQL
> 	2. Populate Collection (RowSet/TableModel/Any other) from ResultSet
> 	3. Pass the collection to Custom Tag
> 	4. Custom Tag will generate <SELECT><Option></SELECT> based on the
> collection.
> 
> In the above scenario will I save any processing (Looping) if I use RowSet?
> If I am using my own
> collection I need to run Loop 1 to create the collection and Loop 2 inside
> Custom Tag to generate
> HTML. RowSet looks like saving the first loop. But how it is internally
> doing? Is it the same way?
> 
> Pls provide your advice.
> 
> Thanks in advance
> 
> Best Regards
> Savant
> 	
> 
> -------------------------------------------------------------------
> This email is confidential and intended only for the use of the individual
> or entity named above and may contain information that is privileged. If you
> are not the intended recipient, you are notified that any dissemination,
> distribution or copying of this email is strictly prohibited. If you have
> received this email in error, please notify us immediately by return email
> or telephone and destroy the original message. Thank you. - This mail is
> sent via Sony Asia Pacific Mail Gateway. 
> -------------------------------------------------------------------




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