DataTableReader
Leave feedback
On this page
Inheritance: java.lang.Object, com.groupdocs.assembly.system.data.common.DbDataReader
public final class DataTableReader extends DbDataReader
The DataTableReader obtains the contents of one or more DataTable objects in the form of one or more read-only, forward-only result sets.
| Constructor | 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. |
| Method | Description |
|---|---|
| getFieldCount() | Returns the number of columns in the current row. |
| isClosed() | Gets a value that indicates whether the DataTableReader is closed. |
| get(int ordinal) | Gets the value of the specified column in its native format given the column ordinal. |
| getName(int ordinal) | Gets the value of the specified column as a java.lang.String. |
| getFieldType(int ordinal) | Gets the java.lang.Class that is the data type of the object. |
| getValue(int ordinal) | Gets the value of the specified column in its native format. |
| read() | Advances the DataTableReader to the next record. |
| getDepth() | The depth of nesting for the current row of the DataTableReader. |
| getRecordsAffected() | Gets the number of rows inserted, changed, or deleted by execution of the SQL statement. |
| close() | Closes the current DataTableReader. |
| getSchemaTable() | Returns a DataTable that describes the column metadata of the DataTableReader. |
| nextResult() | Advances the DataTableReader to the next result set, if any. |
| hasRows() | Gets a value that indicates whether the DataTableReader contains one or more rows. |
| iterator() | Returns an enumerator that can be used to iterate through the item collection. |
| get(String name) | Gets the value of the specified column in its native format given the column name. |
public DataTableReader(DataTable dataTable)
Initializes a new instance of the DataTableReader class by using data from the supplied DataTable.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| dataTable | DataTable | The DataTable from which the new DataTableReader obtains its result set. |
public DataTableReader(DataTable[] dataTables)
Initializes a new instance of the DataTableReader class using the supplied array of DataTable objects.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| dataTables | DataTable[] | The array of DataTable objects that supplies the results for the new DataTableReader object. |
public final int getFieldCount()
Returns the number of columns in the current row.
Returns: int - When not positioned in a valid result set, 0; otherwise the number of columns in the current row.
public final boolean isClosed()
Gets a value that indicates whether the DataTableReader is closed.
Returns: boolean - Returns true if the DataTableReader is closed; otherwise, false.
public final Object get(int ordinal)
Gets the value of the specified column in its native format given the column ordinal.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| ordinal | int | The zero-based column ordinal. |
Returns: java.lang.Object - The value of the specified column in its native format.
public final String getName(int ordinal)
Gets the value of the specified column as a java.lang.String.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| ordinal | int | The zero-based column ordinal |
Returns: java.lang.String - The name of the specified column.
public final Class getFieldType(int ordinal)
Gets the java.lang.Class that is the data type of the object.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| ordinal | int | The zero-based column ordinal. |
Returns: java.lang.Class - The java.lang.Class that is the data type of the object.
public final Object getValue(int ordinal)
Gets the value of the specified column in its native format.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| ordinal | int | The zero-based column ordinal |
Returns: java.lang.Object - The value of the specified column. This method returns DBNull for null columns.
public final boolean read()
Advances the DataTableReader to the next record.
Returns: boolean - true if there was another row to read; otherwise false.
public final int getDepth()
The depth of nesting for the current row of the DataTableReader.
Returns: int - The depth of nesting for the current row; always zero.
public final int getRecordsAffected()
Gets the number of rows inserted, changed, or deleted by execution of the SQL statement.
Returns: int - The DataTableReader does not support this property and always returns 0.
public final void close()
Closes the current DataTableReader.
public final DataTable getSchemaTable()
Returns a DataTable that describes the column metadata of the DataTableReader.
Returns: DataTable - A DataTable that describes the column metadata.
public final boolean nextResult()
Advances the DataTableReader to the next result set, if any.
Returns: boolean - true if there was another result set; otherwise false.
public final boolean hasRows()
Gets a value that indicates whether the DataTableReader contains one or more rows.
Returns: boolean - true if the DataTableReader contains one or more rows; otherwise false.
public final Iterator iterator()
Returns an enumerator that can be used to iterate through the item collection.
Returns: java.util.Iterator - An java.util.Iterator object that represents the item collection.
public final Object get(String name)
Gets the value of the specified column in its native format given the column name.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| name | java.lang.String | The name of the column. |
Returns: java.lang.Object - The value of the specified column in its native format.
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.