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