try {
rs = dbSess.executeQuery(con = dataSource.getConnection(), q);
List<String> lastnames = new ArrayList<String>();
Contact c = new Contact();
while (rs.next()) {
rs.populate(c);
lastnames.add(c.getLastname());
}
return lastnames;
} catch (SQLException ex) {
throw new RuntimeException(ex);