Java Reference
In-Depth Information
+ authorWork.getString(3));
}
} catch (SQLException ex) {
ex.printStackTrace();
}
}
public static void joinRowQuery() {
try {
// Create JoinRowSet
jrs = new JoinRowSetImpl();
// Add RowSet & Corresponding Keys
jrs.addRowSet(bookAuthors, 1);
jrs.addRowSet(authorWork, 2);
// Traverse Results
while(jrs.next()){
System.out.println(jrs.getInt("ID") + ":
" +
jrs.getString("TITLE")
+ " - " +
jrs.getString("FIRSTNAME") + " " +
jrs.getString("LASTNAME"));
}
} catch (SQLException ex) {
ex.printStackTrace();
}
}
}
Running this class will result in output that resembles the following:
Search WWH ::




Custom Search