ResultSet Class
The ResultSet class provides access to a table of data generated by executing a Statement.
Syntax
class ResultSet extends Object
Run On
Called
Methods
Method | Description | |
---|---|---|
cancelTimeOut | Cancels a previous method call to the setTimeOut method. (Inherited from Object.) | |
close | Releases the object's database resources immediately. | |
equal | Determines whether the specified object is equal to the current one. (Inherited from Object.) | |
getBoolean | Retrieves the Boolean value of a column in the current row. | |
getByte | ||
getDate | Retrieves the value of a column in the current row as an Microsoft Dynamics AXdate value. | |
getDateTime | ||
getGuid | ||
getInt | Retrieves the value of a column in the current row as an integer. | |
getInt64 | ||
getMetaData | ||
getReal | Retrieves the value of a column in the current row as a value of the type real. | |
getString | Gets the string value of a column in the current row. | |
getTimeOutTimerHandle | Returns the timer handle for the object. (Inherited from Object.) | |
handle | Retrieves the handle of the class of the object. (Inherited from Object.) | |
new | Initializes a new instance of the Object class. (Inherited from Object.) | |
next | Selects the first or subsequent row. | |
notify | Releases the hold on an object that has called the wait method on this object. (Inherited from Object.) | |
notifyAll | Releases a lock on the object that was issued by the wait method on this object. (Inherited from Object.) | |
objectOnServer | Determines whether the object is on a server. (Inherited from Object.) | |
owner | Returns the instance that owns the object. (Inherited from Object.) | |
setTimeOut | Sets up the scheduled execution of a specified method. (Inherited from Object.) | |
toString | Returns a string that represents the current object. (Inherited from Object.) | |
usageCount | Returns the current number of references, that is, the value of the reference counter, that the object has. (Inherited from Object.) | |
wait | Pauses a process. (Inherited from Object.) | |
wasNull | Reports whether the last column read has the value SQL NULL. | |
xml | Returns an XML string that represents the current object. (Inherited from Object.) |
Top
Remarks
For maximum portability, ResultSet columns within each row should be read in left-to-right order and each column should be read only once.
A ResultSet provides access to a table of data generated by executing a instance. The table rows are retrieved in sequence. Within a row its column values can be accessed in any order.
A ResultSet maintains a cursor that points to its current row of data. Initially the cursor is positioned before the first row. The 'next' method moves the cursor to the next row.
For the getXX methods, Microsoft Dynamics AX attempts to convert the underlying data to the specified type and returns a suitable value.
The getXX (for example,. ) methods retrieve column values for the current row. You retrieve values using the index number of the column. Columns are numbered from 1.
A ResultSet is automatically closed by the statement that generated it when that Statement is closed, re-executed, or is used to retrieve the next result from a sequence of multiple results.
Examples
static void example()
{
Connection Con;
Statement Stmt;
ResultSet R;
SqlStatementExecutePermission perm;
str sql = 'SELECT VALUE FROM SQLSYSTEMVARIABLES';
Con = new Connection();
Stmt = Con.createStatement();
perm = new SqlStatementExecutePermission(sql);
perm.assert();
R = Stmt.executeQuery(sql);
while ( R.next() )
{
print R.getString(1);
}
}
Inheritance Hierarchy
Object Class
ResultSet Class