Provides methods to traverse a table by row, and access the column data.
public interface ResultSet
All members of ResultSet interface, including all inherited members.
Name | Description |
---|---|
Moves the cursor after the last row. | |
Moves the cursor before the first row. | |
Closes the ResultSet object to release the memory resources associated with it. | |
Moves the cursor to the first row. | |
Returns an InputStream object for long binary types, including file-based long binaries. | |
Returns a boolean value. | |
Returns a byte array. | |
Returns a Reader object. | |
Returns a java.util.Date object. | |
Returns a DecimalNumber object. | |
Returns a double value based on the column number. | |
Returns a float value. | |
Returns an integer value. | |
Returns a long integer value. | |
Returns the (base-one) ordinal for the value represented by a String. | |
Returns a ResultSetMetadata object that contains the metadata for the ResultSet object. | |
Gets the number of rows in the table. | |
Gets the actual size of a result set column. | |
Returns a String value. | |
Returns a UUIDValue object. | |
Tests if the value at the specified column number is null. | |
Moves the cursor to the last row. | |
Fetches the next row of data in the ResultSet object. | |
Fetches the previous row of data in the ResultSet object. | |
Moves the cursor by an offset of rows from the current cursor position. |
A ResultSet object is generated when the execute or executeQuery method is called on a PreparedStatement object with a SQL SELECT statement.
The following example demonstrates how to fetch a row in the ResultSet object, and access data from a specified column:
// Define a new SQL SELECT statement. String sql_string = "SELECT column1, column2 FROM SampleTable"; // Create a new PreparedStatement from an existing connection. PreparedStatement ps = conn.prepareStatement(sql_string); // Create a new ResultSet to contain the query results of the SQL statement. ResultSet rs = ps.executeQuery(); // Check if the PreparedStatement contains a ResultSet. if (ps.hasResultSet()) { // Retrieve the column1 value from the first row using getString. String row1_col1 = rs.getString(1); // Get the next row in the table. if (rs.next) { // Retrieve the value of column1 from the second row. String row2_col1 = rs.getString(1); } } rs.close(); ps.close(); |
afterLast method [Android]
beforeFirst method [Android]
close method
first method [Android]
getBlobInputStream method
getBoolean method
getBytes method
getClobReader method
getDate method
getDecimalNumber method
getDouble method
getFloat method
getInt method
getLong method
getOrdinal method
getResultSetMetadata method
getRowCount method [Android]
getSize method
getString method
getUUIDValue method
isNull method
last method [Android]
next method
previous method
relative method [Android]
Discuss this page in DocCommentXchange.
|
Copyright © 2012, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.1 |