jdk/src/share/classes/javax/sql/rowset/spi/SyncResolver.java
changeset 18156 edb590d448c5
parent 5506 202f599c92aa
child 18564 f9db68ff2cbb
equal deleted inserted replaced
18155:889970e5b728 18156:edb590d448c5
   191  * through the columns of that row in both <i>resolver</i> and <i>crs</i>, the conflicting
   191  * through the columns of that row in both <i>resolver</i> and <i>crs</i>, the conflicting
   192  * values can be retrieved and compared to decide which one should be persisted. In this
   192  * values can be retrieved and compared to decide which one should be persisted. In this
   193  * code fragment, the value in <i>crs</i> is the one set as the resolved value, which means
   193  * code fragment, the value in <i>crs</i> is the one set as the resolved value, which means
   194  * that it will be used to overwrite the conflict value in the data source.
   194  * that it will be used to overwrite the conflict value in the data source.
   195  *
   195  *
   196  * <PRE>
   196  * <PRE>{@code
   197  *     try {
   197  *     try {
   198  *
   198  *
   199  *         crs.acceptChanges(con);
   199  *         crs.acceptChanges(con);
   200  *
   200  *
   201  *     } catch (SyncProviderException spe) {
   201  *     } catch (SyncProviderException spe) {
   202  *
   202  *
   203  *         SyncResolver resolver = spe.getSyncResolver();
   203  *         SyncResolver resolver = spe.getSyncResolver();
   204  *
   204  *
   205  *         Object crsValue;  // value in the <code>RowSet</code> object
   205  *         Object crsValue;  // value in the RowSet object
   206  *         Object resolverValue:  // value in the <code>SyncResolver</code> object
   206  *         Object resolverValue:  // value in the SyncResolver object
   207  *         Object resolvedValue:  // value to be persisted
   207  *         Object resolvedValue:  // value to be persisted
   208  *
   208  *
   209  *         while(resolver.nextConflict())  {
   209  *         while(resolver.nextConflict())  {
   210  *             if(resolver.getStatus() == SyncResolver.UPDATE_ROW_CONFLICT)  {
   210  *             if(resolver.getStatus() == SyncResolver.UPDATE_ROW_CONFLICT)  {
   211  *                 int row = resolver.getRow();
   211  *                 int row = resolver.getRow();
   225  *                      }
   225  *                      }
   226  *                  }
   226  *                  }
   227  *              }
   227  *              }
   228  *          }
   228  *          }
   229  *      }
   229  *      }
   230  * </PRE>
   230  * }</PRE>
   231  * @author  Jonathan Bruce
   231  * @author  Jonathan Bruce
   232  */
   232  */
   233 
   233 
   234 public interface SyncResolver extends RowSet {
   234 public interface SyncResolver extends RowSet {
   235     /**
   235     /**