FileDocCategorySizeDatePackage
Client.javaAPI DocJBoss 4.2.12030Fri Jul 13 20:55:20 BST 2007org.jboss.tutorial.dependent.client

Client

public class Client extends Object

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)

      InitialContext ctx = new InitialContext();
      CustomerDAO dao = (CustomerDAO) ctx.lookup("CustomerDAOBean/remote");

      System.out.println("Create Bill Burke and Monica Smith");
      dao.create("Bill", "Burke", "1 Boston Road", "Boston", "MA", "02115");
      int moId = dao.create("Monica", "Smith", "1 Boston Road", "Boston", "MA", "02115");

      System.out.println("Bill and Monica get married");
      Customer monica = dao.find(moId);
      monica.getName().setLast("Burke");
      dao.merge(monica);

      System.out.println("Get all the Burkes");
      List burkes = dao.findByLastName("Burke");
      System.out.println("There are now " + burkes.size() + " Burkes");