DataTableReader

Inheritance: java.lang.Object, com.aspose.words.net.System.Data.Common.DbDataReader

public class DataTableReader extends System.Data.Common.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.

Constructors

ConstructorDescription
DataTableReader(System.Data.DataTable dataTable)Initializes a new instance of the DataTableReader class by using data from the supplied DataTable.
DataTableReader(System.Data.DataTable[] dataTables)Initializes a new instance of the DataTableReader class using the supplied array of DataTable objects.

Methods

MethodDescription
close()Closes the current DataTableReader.
get(int ordinal)Gets the value of the specified column in its native format given the column ordinal.
get(String name)Gets the value of the specified column in its native format given the column name.
getDepth()The depth of nesting for the current row of the DataTableReader.
getFieldCount()Returns the number of columns in the current row.
getFieldType(int ordinal)Gets the java.lang.Class that is the data type of the object.
getName(int ordinal)Gets the value of the specified column as a java.lang.String.
getRecordsAffected()Gets the number of rows inserted, changed, or deleted by execution of the SQL statement.
getSchemaTable()Returns a DataTable that describes the column metadata of the DataTableReader.
getValue(int ordinal)Gets the value of the specified column in its native format.
hasRows()Gets a value that indicates whether the DataTableReader contains one or more rows.
isClosed()Gets a value that indicates whether the DataTableReader is closed.
iterator()Returns an enumerator that can be used to iterate through the item collection.
nextResult()Advances the DataTableReader to the next result set, if any.
read()Advances the DataTableReader to the next record.

DataTableReader(System.Data.DataTable dataTable)

public DataTableReader(System.Data.DataTable dataTable)

Initializes a new instance of the DataTableReader class by using data from the supplied DataTable.

Parameters:

ParameterTypeDescription
dataTableDataTableThe DataTable from which the new DataTableReader obtains its result set.

DataTableReader(System.Data.DataTable[] dataTables)

public DataTableReader(System.Data.DataTable[] dataTables)

Initializes a new instance of the DataTableReader class using the supplied array of DataTable objects.

Parameters:

ParameterTypeDescription
dataTablesDataTable[]The array of DataTable objects that supplies the results for the new DataTableReader object.

close()

public void close()

Closes the current DataTableReader.

get(int ordinal)

public Object get(int ordinal)

Gets the value of the specified column in its native format given the column ordinal.

Parameters:

ParameterTypeDescription
ordinalintThe zero-based column ordinal.

Returns: java.lang.Object - The value of the specified column in its native format.

get(String name)

public Object get(String name)

Gets the value of the specified column in its native format given the column name.

Parameters:

ParameterTypeDescription
namejava.lang.StringThe name of the column.

Returns: java.lang.Object - The value of the specified column in its native format.

getDepth()

public 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.

getFieldCount()

public 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.

getFieldType(int ordinal)

public Class getFieldType(int ordinal)

Gets the java.lang.Class that is the data type of the object.

Parameters:

ParameterTypeDescription
ordinalintThe zero-based column ordinal.

Returns: java.lang.Class - The java.lang.Class that is the data type of the object.

getName(int ordinal)

public String getName(int ordinal)

Gets the value of the specified column as a java.lang.String.

Parameters:

ParameterTypeDescription
ordinalintThe zero-based column ordinal

Returns: java.lang.String - The name of the specified column.

getRecordsAffected()

public 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.

getSchemaTable()

public System.Data.DataTable getSchemaTable()

Returns a DataTable that describes the column metadata of the DataTableReader.

Returns: DataTable - A DataTable that describes the column metadata.

getValue(int ordinal)

public Object getValue(int ordinal)

Gets the value of the specified column in its native format.

Parameters:

ParameterTypeDescription
ordinalintThe zero-based column ordinal

Returns: java.lang.Object - The value of the specified column. This method returns DBNull for null columns.

hasRows()

public 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.

isClosed()

public boolean isClosed()

Gets a value that indicates whether the DataTableReader is closed.

Returns: boolean - Returns true if the DataTableReader is closed; otherwise, false.

iterator()

public 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.

nextResult()

public boolean nextResult()

Advances the DataTableReader to the next result set, if any.

Returns: boolean - true if there was another result set; otherwise false.

read()

public boolean read()

Advances the DataTableReader to the next record.

Returns: boolean - true if there was another row to read; otherwise false.