1. /*
  2. * @(#)RowSetReader.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. * The facility that a disconnected <code>RowSet</code> object calls on
  11. * to populate itself with rows of data. A reader (an object implementing the
  12. * <code>RowSetReader</code> interface) may be registered with
  13. * a <code>RowSet</code> object that supports the reader/writer paradigm.
  14. * When the <code>RowSet</code> object's <code>execute</code> method is
  15. * called, it in turn calls the reader's <code>readData</code> method.
  16. *
  17. * @since 1.4
  18. */
  19. public interface RowSetReader {
  20. /**
  21. * Reads the new contents of the calling <code>RowSet</code> object.
  22. * In order to call this method, a <code>RowSet</code>
  23. * object must have implemented the <code>RowSetInternal</code> interface
  24. * and registered this <code>RowSetReader</code> object as its reader.
  25. * The <code>readData</code> method is invoked internally
  26. * by the <code>RowSet.execute</code> method for rowsets that support the
  27. * reader/writer paradigm.
  28. *
  29. * <P>The <code>readData</code> method adds rows to the caller.
  30. * It can be implemented in a wide variety of ways and can even
  31. * populate the caller with rows from a nonrelational data source.
  32. * In general, a reader may invoke any of the rowset's methods,
  33. * with one exception. Calling the method <code>execute</code> will
  34. * cause an <code>SQLException</code> to be thrown
  35. * because <code>execute</code> may not be called recursively. Also,
  36. * when a reader invokes <code>RowSet</code> methods, no listeners
  37. * are notified; that is, no <code>RowSetEvent</code> objects are
  38. * generated and no <code>RowSetListener</code> methods are invoked.
  39. * This is true because listeners are already being notified by the method
  40. * <code>execute</code>.
  41. *
  42. * @param caller the <code>RowSet</code> object (1) that has implemented the
  43. * <code>RowSetInternal</code> interface, (2) with which this reader is
  44. * registered, and (3) whose <code>execute</code> method called this reader
  45. * @exception SQLException if a database access error occurs or this method
  46. * invokes the <code>RowSet.execute</code> method
  47. */
  48. void readData(RowSetInternal caller) throws SQLException;
  49. }