Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 11.0.1 » UltraLiteJ » UltraLiteJ Reference » UltraLiteJ API reference


CollectionOfValueReaders interface

Provides methods to return the column value of a given row.

public CollectionOfValueReaders
Derived classes

The returned results are based on a SQL SELECT statement, which is declared by a PreparedStatement, and are stored in a ResultSet.

Values returned by any given method in this interface are accessed based on the integer parameter, ordinal, which specifies the column order as it appears in the SQL SELECT statement. The ordinal has a base index of one.

Values are returned as either java primitive types or read-only Value objects.

The following example demonstrates how to declare a new PreparedStatement with a SQL SELECT statement, execute the statement, store the query results in a new ResultSet, and store a column1 value as a String using a get method.

// 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 using getString.
    String row1_col1 = rs.getString(1);

All members of CollectionOfValueReaders, including all inherited members.

getBlobInputStream method
getBoolean method
getBytes method
getClobReader method
getDate method
getDecimalNumber method
getDouble method
getFloat method
getInt method
getLong method
getOrdinal method
getString method
getValue method
isNull method