public final class DataTableReader extends DbDataReader
DataTableReader
obtains the contents of one or more DataTable
objects in the form of one or more read-only, forward-only result sets.Constructor and Description |
---|
DataTableReader(DataTable dataTable)
Initializes a new instance of the
DataTableReader class by using data from the supplied DataTable . |
DataTableReader(DataTable[] dataTables)
Initializes a new instance of the
DataTableReader class using the supplied array of DataTable objects. |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the current
DataTableReader . |
java.lang.Object |
get(int ordinal)
Gets the value of the specified column in its native format given the column ordinal.
|
java.lang.Object |
get(java.lang.String name)
Gets the value of the specified column in its native format given the column name.
|
int |
getDepth()
The depth of nesting for the current row of the
DataTableReader . |
int |
getFieldCount()
Returns the number of columns in the current row.
|
java.lang.Class |
getFieldType(int ordinal)
Gets the
Class that is the data type of the object. |
java.lang.String |
getName(int ordinal)
Gets the value of the specified column as a
String . |
int |
getRecordsAffected()
Gets the number of rows inserted, changed, or deleted by execution of the SQL statement.
|
DataTable |
getSchemaTable()
Returns a
DataTable that describes the column metadata of the DataTableReader . |
java.lang.Object |
getValue(int ordinal)
Gets the value of the specified column in its native format.
|
boolean |
hasRows()
Gets a value that indicates whether the
DataTableReader contains one or more rows. |
boolean |
isClosed()
Gets a value that indicates whether the
DataTableReader is closed. |
java.util.Iterator |
iterator()
Returns an enumerator that can be used to iterate through the item collection.
|
boolean |
nextResult()
Advances the
DataTableReader to the next result set, if any. |
boolean |
read()
Advances the
DataTableReader to the next record. |
public DataTableReader(DataTable dataTable)
DataTableReader
class by using data from the supplied DataTable
.dataTable
- The DataTable
from which the new DataTableReader
obtains its result set.public DataTableReader(DataTable[] dataTables)
DataTableReader
class using the supplied array of DataTable
objects.dataTables
- The array of DataTable
objects that supplies the results for the new DataTableReader
object.public final int getFieldCount()
public final boolean isClosed()
DataTableReader
is closed.DataTableReader
is closed; otherwise, false.public final java.lang.Object get(int ordinal)
ordinal
- The zero-based column ordinal.public final java.lang.String getName(int ordinal)
String
.ordinal
- The zero-based column ordinalpublic final java.lang.Class getFieldType(int ordinal)
Class
that is the data type of the object.ordinal
- The zero-based column ordinal.Class
that is the data type of the object.public final java.lang.Object getValue(int ordinal)
ordinal
- The zero-based column ordinalpublic final boolean read()
DataTableReader
to the next record.public final int getDepth()
DataTableReader
.public final int getRecordsAffected()
DataTableReader
does not support this property and always returns 0.public final void close()
DataTableReader
.public final DataTable getSchemaTable()
DataTable
that describes the column metadata of the DataTableReader
.DataTable
that describes the column metadata.public final boolean nextResult()
DataTableReader
to the next result set, if any.public final boolean hasRows()
DataTableReader
contains one or more rows.DataTableReader
contains one or more rows; otherwise false.public final java.util.Iterator iterator()
Iterator
object that represents the item collection.public final java.lang.Object get(java.lang.String name)
get
in class DbDataReader
name
- The name of the column.