1 /* 2 * @(#)RowSetWriter.java 1.8 03/12/19 3 * 4 * Copyright 2004 Sun Microsystems, Inc. All rights reserved. 5 * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. 6 */ 7 8 package javax.sql; 9 10 import java.sql.*; 11 12 /** 13 * An object that implements the <code>RowSetWriter</code> interface, 14 * called a <i>writer</i>. A writer may be registered with a <code>RowSet</code> 15 * object that supports the reader/writer paradigm. 16 * <P> 17 * If a disconnected <code>RowSet</code> object modifies some of its data, 18 * and it has a writer associated with it, it may be implemented so that it 19 * calls on the writer's <code>writeData</code> method internally 20 * to write the updates back to the data source. In order to do this, the writer 21 * must first establish a connection with the rowset's data source. 22 * <P> 23 * If the data to be updated has already been changed in the data source, there 24 * is a conflict, in which case the writer will not write 25 * the changes to the data source. The algorithm the writer uses for preventing 26 * or limiting conflicts depends entirely on its implementation. 27 * 28 * @since 1.4 29 */ 30 31 public interface RowSetWriter { 32 33 /** 34 * Writes the changes in this <code>RowSetWriter</code> object's 35 * rowset back to the data source from which it got its data. 36 * 37 * @param caller the <code>RowSet</code> object (1) that has implemented the 38 * <code>RowSetInternal</code> interface, (2) with which this writer is 39 * registered, and (3) that called this method internally 40 * @return <code>true</code> if the modified data was written; <code>false</code> 41 * if not, which will be the case if there is a conflict 42 * @exception SQLException if a database access error occurs 43 */ 44 boolean writeData(RowSetInternal caller) throws SQLException; 45 46 } 47