Query query = new Query();
query.select("c.fname,c.lname,s.order_date,s.id");
query.from("Customer", "c");
query.join("Sales_order", "s", "s.cust_id", "c.id");
AttributeTest ts = new AttributeTest();
ts.setAttribute("lname");
ts.setTestValue("Smith");
ts.setOperator(AttributeTest.EQUAL);
query.setTestCriteria(ts);
QueryResultSet qrs = SMP101DB.executeQuery(query);
while(qrs.next())
{
System.out.println("order: " +
qrs.getInt(4) + // 4 is s.id
qrs.getString(1) + // 1 is c.fname
", " + qrs.getString(2) + // 2 is c.lname
" " + qrs.getDate(3)); // 3 is s.order_date
}