RowSetReader
Stay organized with collections
Save and categorize content based on your preferences.
The facility that a disconnected RowSet
object calls on
to populate itself with rows of data. A reader (an object implementing the
RowSetReader
interface) may be registered with
a RowSet
object that supports the reader/writer paradigm.
When the RowSet
object's execute
method is
called, it in turn calls the reader's readData
method.
Public Methods
public
abstract
void
readData
(RowSetInternal caller)
Reads the new contents of the calling RowSet
object.
In order to call this method, a RowSet
object must have implemented the RowSetInternal
interface
and registered this RowSetReader
object as its reader.
The readData
method is invoked internally
by the RowSet.execute
method for rowsets that support the
reader/writer paradigm.
The readData
method adds rows to the caller.
It can be implemented in a wide variety of ways and can even
populate the caller with rows from a nonrelational data source.
In general, a reader may invoke any of the rowset's methods,
with one exception. Calling the method execute
will
cause an SQLException
to be thrown
because execute
may not be called recursively. Also,
when a reader invokes RowSet
methods, no listeners
are notified; that is, no RowSetEvent
objects are
generated and no RowSetListener
methods are invoked.
This is true because listeners are already being notified by the method
execute
.
Parameters
caller |
the RowSet object (1) that has implemented the
RowSetInternal interface, (2) with which this reader is
registered, and (3) whose execute method called this reader |
Throws
SQLException |
if a database access error occurs or this method
invokes the RowSet.execute method
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-07-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-07-10 UTC."],[[["\u003cp\u003e\u003ccode\u003eRowSetReader\u003c/code\u003e is an interface used by \u003ccode\u003eRowSet\u003c/code\u003e objects to populate data.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eRowSet\u003c/code\u003e objects register a \u003ccode\u003eRowSetReader\u003c/code\u003e to handle data population.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ereadData\u003c/code\u003e method of \u003ccode\u003eRowSetReader\u003c/code\u003e is called by \u003ccode\u003eRowSet.execute\u003c/code\u003e to read and add new rows to the \u003ccode\u003eRowSet\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003ereadData\u003c/code\u003e can fetch data from various sources, including non-relational ones.\u003c/p\u003e\n"],["\u003cp\u003eReaders can use most \u003ccode\u003eRowSet\u003c/code\u003e methods except for \u003ccode\u003eexecute\u003c/code\u003e to avoid recursion.\u003c/p\u003e\n"]]],["A `RowSetReader` populates a `RowSet` with data. When a `RowSet`'s `execute` method is invoked, it calls the `readData` method of its registered `RowSetReader`. `readData` adds rows to the `RowSet`, sourced from potentially non-relational data. It can call `RowSet` methods, except `execute` to avoid recursion. Invoking `RowSet` methods will not trigger listener notification. `readData` can throw an `SQLException` if there is a database error.\n"],null,["public interface **RowSetReader** \nThe facility that a disconnected `RowSet` object calls on\nto populate itself with rows of data. A reader (an object implementing the\n`RowSetReader` interface) may be registered with\na `RowSet` object that supports the reader/writer paradigm.\nWhen the `RowSet` object's `execute` method is\ncalled, it in turn calls the reader's `readData` method. \n\nPublic Method Summary\n\n|---------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract void | [readData](../../../reference/javax/sql/RowSetReader.html#readData(javax.sql.RowSetInternal))([RowSetInternal](../../../reference/javax/sql/RowSetInternal.html) caller) Reads the new contents of the calling `RowSet` object. |\n\nPublic Methods \n\npublic abstract void\n**readData**\n([RowSetInternal](../../../reference/javax/sql/RowSetInternal.html) caller) \nReads the new contents of the calling `RowSet` object.\nIn order to call this method, a `RowSet`\nobject must have implemented the `RowSetInternal` interface\nand registered this `RowSetReader` object as its reader.\nThe `readData` method is invoked internally\nby the `RowSet.execute` method for rowsets that support the\nreader/writer paradigm.\n\nThe `readData` method adds rows to the caller.\nIt can be implemented in a wide variety of ways and can even\npopulate the caller with rows from a nonrelational data source.\nIn general, a reader may invoke any of the rowset's methods,\nwith one exception. Calling the method `execute` will\ncause an `SQLException` to be thrown\nbecause `execute` may not be called recursively. Also,\nwhen a reader invokes `RowSet` methods, no listeners\nare notified; that is, no `RowSetEvent` objects are\ngenerated and no `RowSetListener` methods are invoked.\nThis is true because listeners are already being notified by the method\n`execute`. \n\nParameters\n\n| caller | the `RowSet` object (1) that has implemented the `RowSetInternal` interface, (2) with which this reader is registered, and (3) whose `execute` method called this reader |\n|--------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n\nThrows\n\n| [SQLException](../../../reference/java/sql/SQLException.html) | if a database access error occurs or this method invokes the `RowSet.execute` method |\n|---------------------------------------------------------------|--------------------------------------------------------------------------------------|"]]