1 /*
2  * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * This code is free software; you can redistribute it and/or modify it
6  * under the terms of the GNU General Public License version 2 only, as
7  * published by the Free Software Foundation.  Oracle designates this
8  * particular file as subject to the "Classpath" exception as provided
9  * by Oracle in the LICENSE file that accompanied this code.
10  *
11  * This code is distributed in the hope that it will be useful, but WITHOUT
12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14  * version 2 for more details (a copy is included in the LICENSE file that
15  * accompanied this code).
16  *
17  * You should have received a copy of the GNU General Public License version
18  * 2 along with this work; if not, write to the Free Software Foundation,
19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20  *
21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22  * or visit www.oracle.com if you need additional information or have any
23  * questions.
24  */
25 
26 package javax.sql;
27 
28 import java.sql.*;
29 
30 /**
31  * The facility that a disconnected <code>RowSet</code> object calls on
32  * to populate itself with rows of data. A reader (an object implementing the
33  * <code>RowSetReader</code> interface) may be registered with
34  * a <code>RowSet</code> object that supports the reader/writer paradigm.
35  * When the <code>RowSet</code> object's <code>execute</code> method is
36  * called, it in turn calls the reader's <code>readData</code> method.
37  *
38  * @since 1.4
39  */
40 
41 public interface RowSetReader {
42 
43   /**
44    * Reads the new contents of the calling <code>RowSet</code> object.
45    * In order to call this method, a <code>RowSet</code>
46    * object must have implemented the <code>RowSetInternal</code> interface
47    * and registered this <code>RowSetReader</code> object as its reader.
48    * The <code>readData</code>  method is invoked internally
49    * by the <code>RowSet.execute</code> method for rowsets that support the
50    * reader/writer paradigm.
51    *
52    * <P>The <code>readData</code> method adds rows to the caller.
53    * It can be implemented in a wide variety of ways and can even
54    * populate the caller with rows from a nonrelational data source.
55    * In general, a reader may invoke any of the rowset's methods,
56    * with one exception. Calling the method <code>execute</code> will
57    * cause an <code>SQLException</code> to be thrown
58    * because <code>execute</code> may not be called recursively.  Also,
59    * when a reader invokes <code>RowSet</code> methods, no listeners
60    * are notified; that is, no <code>RowSetEvent</code> objects are
61    * generated and no <code>RowSetListener</code> methods are invoked.
62    * This is true because listeners are already being notified by the method
63    * <code>execute</code>.
64    *
65    * @param caller the <code>RowSet</code> object (1) that has implemented the
66    *         <code>RowSetInternal</code> interface, (2) with which this reader is
67    *        registered, and (3) whose <code>execute</code> method called this reader
68    * @exception SQLException if a database access error occurs or this method
69    *            invokes the <code>RowSet.execute</code> method
70    */
readData(RowSetInternal caller)71   void readData(RowSetInternal caller) throws SQLException;
72 
73 }
74