Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void findPilotByName() throws NamingException
- {
- ReadEntityRemote re;
- InitialContext ctx = new InitialContext();
- re=(ReadEntityRemote)ctx.lookup("read");
- Scanner reader = new Scanner(System.in);
- String name = null;
- try{
- System.out.print("Enter the name of the PILOT that you want to find: ");
- name = reader.nextLine();
- }catch (Exception e) {
- showException(e);
- }
- List<Pilot> List = re.findPiloteByName(name);
- List.stream().map((o) -> (Pilot)o).forEachOrdered((p) -> {
- System.out.println("ID : " + p.getId()+ " Name of the Pilot : " + p.getName());
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement