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