Java Reference
In-Depth Information
updating within the row. Once you have updated the column or columns within the
row, call the updateRow() method. This technique is demonstrated in the solution to
this recipe.
crs.updateString("description", "Subject to change");
crs.updateRow();
To propagate any updates or inserts to the database, the acceptChanges()
method must be called. This method can accept an optional Connection argument in
order to connect to the database. Once called, all changes are flushed to the database.
Unfortunately, because time might have elapsed since the data was last retrieved for the
CachedRowSet , there could be conflicts. If such a conflict arises, a SyncPro-
viderException will be thrown. You can catch these exceptions and handle the
conflicts manually using a SyncResolver object. However, resolving conflicts is
out of the scope of this recipe, so for more information, see the online documentation
that can be found at http://download.oracle.com/javase/tutorial/
jdbc/basics/cachedrowset.html .
CachedRowSet objects provide great flexibility for working with data, especially
when you are using a device that is not always connected to the database. However,
they can also be overkill in situations where you can simply use a standard Res-
ultSet or even a scrollable ResultSet .
13-11. Joining RowSet Objects When Not
Connected to the Data Source
Problem
You want to join two or more RowSets while not connected to a database. Perhaps
your application is loaded on a mobile device that is not always connected to the data-
base. In such a case, you are looking for a solution that will allow you to join the res-
ults of two or more queries.
Solution
Search WWH ::




Custom Search