Skip Headers

# Using a DirectReadQuery

Previous

Next

You can use a `DirectReadQuery` to read a single column of data (that is, one field) that returns a `Collection` of the `DatabaseRows` representing the result set, as Example: Using a DirectReadQuery shows.

Using a DirectReadQuery

    DirectReadQuery directReadQuery = new DirectReadQuery();
    directReadQuery.setSQLStatement(sqlStatement);

    // queryResults is a Vector of DatabaseRow objects
    Vector queryResults = (Vector)session.executeQuery(directReadQuery);