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.getString("BOOK_ID")
                + " - "
                + jrs.getString("FIRSTNAME")
                + " "
                + jrs.getString("LASTNAME"));
      }

    } catch (SQLException ex) {
      ex.printStackTrace();
    }
  }