Advertisement
Guest User

Untitled

a guest
Nov 20th, 2017
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. public void findPilotByName() throws NamingException
  2. {
  3. ReadEntityRemote re;
  4. InitialContext ctx = new InitialContext();
  5. re=(ReadEntityRemote)ctx.lookup("read");
  6. Scanner reader = new Scanner(System.in);
  7. String name = null;
  8. try{
  9. System.out.print("Enter the name of the PILOT that you want to find: ");
  10. name = reader.nextLine();
  11. }catch (Exception e) {
  12. showException(e);
  13. }
  14. List<Pilot> List = re.findPiloteByName(name);
  15. List.stream().map((o) -> (Pilot)o).forEachOrdered((p) -> {
  16. System.out.println("ID : " + p.getId()+ " Name of the Pilot : " + p.getName());
  17. });
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement