final Cursor cursor = statement.getCursor();
// Iterate through the the result set. For each row, add a
// new DirectoryItem object to the vector.
while (cursor.next()) {
final Row row = cursor.getRow();
final int id = row.getInteger(0);
final int categoryId = row.getInteger(1);
final String name = row.getString(2);
final String location = row.getString(3);
final String phone = row.getString(4);
final DirectoryItem item =
new DirectoryItem(id, name, location, phone, categoryId);
directoryItems.addElement(item);
}