FileDocCategorySizeDatePackage
CustomerBean.javaAPI DocExample2727Sat Oct 04 00:41:32 BST 2003headfirst

CustomerBean

public abstract class CustomerBean extends Object implements EntityBean

Fields Summary
private EntityContext
context
private double
customerDiscount
Constructors Summary
Methods Summary
public voiddoEnvLookup()

      try {
        InitialContext ic = new InitialContext();
        Double dbl =  (Double) ic.lookup("java:comp/env/custDiscount");
        customerDiscount = dbl.doubleValue();
        // use the primitive double value to calculate the discount

      } catch (Exception ex) {
         ex.printStackTrace();
      }
  
public voiddoLookup()

      try {
        InitialContext ic = new InitialContext();
        DataSource ds =  (DataSource) ic.lookup("java:comp/env/jdbc/CustomerDB");
        Connection conn = ds.getConnection();
      } catch (Exception ex) {
         ex.printStackTrace();
      }
  
public voidejbActivate()

 
public java.lang.StringejbCreate(java.lang.String last, java.lang.String first, java.lang.String addr, java.lang.String ID)

     System.out.println("in create");
     this.setLast(last);
     this.setFirst(first);
     this.setPK(ID);
     this.setCustAddress(addr);
     this.setLimit(2000.00);
     System.out.println("finishing create");
     return null;        
   
public voidejbLoad()

 
public voidejbPassivate()

 
public voidejbPostCreate(java.lang.String last, java.lang.String first, java.lang.String addr, java.lang.String ID)

     System.out.println("in ejbPostCreate");
  
public voidejbRemove()

 
public voidejbStore()

 
public java.lang.StringgetAddress()

      return this.getCustAddress();
   
public doublegetCreditLimit()

      return this.getLimit();
   
public abstract java.lang.StringgetCustAddress()

public abstract java.lang.StringgetFirst()

public java.lang.StringgetFirstName()

      return this.getFirst();
   
public abstract java.lang.StringgetLast()

public java.lang.StringgetLastName()

      return this.getLast();
   
public abstract doublegetLimit()

public abstract java.lang.StringgetPK()

public voidsetAddress(java.lang.String addr)

      this.setCustAddress(addr);
   
public voidsetCreditLimit(double amt)

      this.setLimit(amt);
   
public abstract voidsetCustAddress(java.lang.String addr)

public voidsetEntityContext(EntityContext ctx)

      context = ctx;
   
public abstract voidsetFirst(java.lang.String first)

public voidsetFirstName(java.lang.String name)

      this.setFirst(name);
   
public abstract voidsetLast(java.lang.String last)

public voidsetLastName(java.lang.String name)

      this.setLast(name);
   
public abstract voidsetLimit(double amt)

public abstract voidsetPK(java.lang.String pk)

public voidunsetEntityContext()