Home | History | Annotate | Download | only in sql
      1 /*
      2  * Licensed to the Apache Software Foundation (ASF) under one or more
      3  * contributor license agreements.  See the NOTICE file distributed with
      4  * this work for additional information regarding copyright ownership.
      5  * The ASF licenses this file to You under the Apache License, Version 2.0
      6  * (the "License"); you may not use this file except in compliance with
      7  * the License.  You may obtain a copy of the License at
      8  *
      9  *     http://www.apache.org/licenses/LICENSE-2.0
     10  *
     11  * Unless required by applicable law or agreed to in writing, software
     12  * distributed under the License is distributed on an "AS IS" BASIS,
     13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     14  * See the License for the specific language governing permissions and
     15  * limitations under the License.
     16  */
     17 
     18 package javax.sql;
     19 
     20 import java.sql.SQLException;
     21 
     22 /**
     23  * An interface which provides functionality for a disconnected {@code RowSet}
     24  * to get data from a database into its rows. The {@code RowSet} calls the
     25  * {@code RowSetReader} interface when the {@code RowSet}'s execute method is
     26  * invoked - a {@code RowSetReader} must first be registered with the {@code
     27  * RowSet} for this to work.
     28  *
     29  * @see RowSet
     30  */
     31 public interface RowSetReader {
     32 
     33     /**
     34      * Reads new data into the {@code RowSet}. The calling {@code RowSet} object
     35      * must itself implement the {@code RowSetInternal} interface and the
     36      * {@code RowSetReader} must be registered as a reader on the
     37      * {@code RowSet}.
     38      * <p>
     39      * This method adds rows into the calling {@code RowSet}. The reader may
     40      * invoke any of the {@code RowSet}'s methods except for the {@code execute}
     41      * method (calling {@code execute} will cause an {@code SQLException} to be
     42      * thrown). However, when the reader calls the {@code RowSet}'s methods, no
     43      * events are sent to listeners - any listeners are informed by the calling
     44      * {@code RowSet}'s {@code execute} method once the reader returns from the
     45      * {@code readData} method.
     46      *
     47      * @param theCaller
     48      *            must be the calling {@code RowSet} object, which must have
     49      *            implemented the {@code RowSetInternal} interface.
     50      * @throws SQLException
     51      *             if a problem occurs accessing the database or if the reader
     52      *             calls the {@link RowSet#execute()} method.
     53      * @see RowSetInternal
     54      */
     55     public void readData(RowSetInternal theCaller) throws SQLException;
     56 }
     57