Subject: Re: [MVC-Programmers] CachedRowSet - updates limited to single table From: Vic Cekvenich <[EMAIL PROTECTED]> === A good use for Cached Row Set is as a disconnected collection of rows. I use it to store the data after I do a Select (instead of a collection) A nice feature of RowSet is getMetaData method, that explains the information about the data. I create an update, or an insert or a delete I do so "manualy" and not use the RowSet. I enumerate the meta data about each row, then I enumerate each column, and create for example a an Update SQL String / Prepared Statment. Look at WebPIM for my Design. It is a generic update. It can be easily extended to do multi table, or you can overide the DAO and "hardcode" the join update(). Above is a good design.
An alternative design is this Create a Company update Form Create a User update Form. When selecting you can do a SQL join and use the JSTL or Display Tag. When updating on a single screen.... Well you can have multiple users on a page per company. So you would display company and users that iterate. Hence a company form bean that contains a user form beans (and each bean implements iterator). So alternative is a formBean iterator that contains other formBean iterators (thata each have a DAO that uses a disconnected row set for a collection). Very clean, IMO. Do not use crs.acceptChanges in either case. Done all the time, most Forms in most applications are master detail or many to many or several at the same time. HTH, V. Todd G. Nist wrote: >Hello, > >We have a CachedRowSet which is created from a SQL statement which joins the >User table to the Company table to display company information for the User. >We allow the user of the system to select a record and drill in for >updating. Since the CachedRowSet was created with a join, it keeps throwing >an exception when we apply the this.crs.acceptChanges(connection); method. >I did not see anything in the CachedRowSet documentation which states that >it only supports a single table. > >So does a CachedRowSet only support updating a single table or am I missing >something? > >Thanks is advance. > >Regards, > >Todd G. Nist >Email: [EMAIL PROTECTED] > > > > > Hello, > > We have a CachedRowSet which is created from a SQL statement which > joins the User table to the Company table to display company > information for the User. We allow the user of the system to select a > record and drill in for updating. Since the CachedRowSet was created > with a join, it keeps throwing an exception when we apply the > this.crs.acceptChanges(connection); method. I did not see anything > in the CachedRowSet documentation which states that it only supports a > single table. > > So does a CachedRowSet only support updating a single table or am I > missing something? > > Thanks is advance. > > Regards, > > Todd G. Nist > Email: [EMAIL PROTECTED] > >_______________________________________________ >MVC-Programmers mailing list >[EMAIL PROTECTED] >http://www.basebeans.com:8081/mailman/listinfo/mvc-programmers > > > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>