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 |
---|---|
Closes the ResultSet to release the memory resources associated with it. | |
Returns an InputStream for long binary types, including file-based long binarys. | |
Returns a boolean value. | |
Returns a byte array. | |
Returns a Reader. | |
Returns a java.util.Date. | |
Returns a DecimalNumber. | |
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 the ResultSetMetadata containing the meta data for the ResultSet. | |
Get the actual size of a result set column. | |
Returns a String value. | |
Returns a UUIDValue value. | |
Tests if the value at the specified column number is null. | |
Fetches the next row of data in the ResultSet. | |
Fetches the previous row of data in the ResultSet. |
A ResultSet is generated by executing a PreparedStatement with a SQL SELECT statement using the execute or executeQuery methods.
The following example demonstrates how to execute a new PreparedStatement, fetch a row with the ResultSet, 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(); |
close method
getBlobInputStream method
getBoolean method
getBytes method
getClobReader method
getDate method
getDecimalNumber method
getDouble method
getFloat method
getInt method
getLong method
getOrdinal method
getResultSetMetadata method
getSize method
getString method
getUUIDValue method
isNull method
next method
previous method
Discuss this page in DocCommentXchange.
|
Copyright © 2010, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.0 |