⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ejbaccountsbean.java~35~

📁 一个J2EE四层架构的实例
💻 JAVA~35~
字号:
package sqlaccounts;import java.io.Serializable;import java.util.Enumeration;import java.util.Vector;import javax.ejb.CreateException;import javax.ejb.DuplicateKeyException;import javax.ejb.EJBException;import javax.ejb.EntityBean;import javax.ejb.EntityContext;import javax.ejb.FinderException;import javax.ejb.NoSuchEntityException;import javax.ejb.ObjectNotFoundException;import javax.ejb.RemoveException;import javax.naming.InitialContext;import javax.naming.NamingException;import javax.sql.DataSource;abstract public class EjbAccountsBean implements EntityBean {  EntityContext entityContext;  public java.lang.String ejbCreate(java.lang.String id, String Type, double bal) throws CreateException {    setId(id);    setType(Type);    setBal(bal);    return null;  }  public java.lang.String ejbCreate(String Id) throws CreateException {    /**@todo Complete this method*/    setId(Id);    return null;  }  public void ejbPostCreate(java.lang.String id, String Type, double bal) throws CreateException {    /**@todo Complete this method*/  }  public void ejbPostCreate(String Id) throws CreateException {    /**@todo Complete this method*/  }  public void ejbRemove() throws RemoveException {    /**@todo Complete this method*/  }  public abstract void setId(java.lang.String id);  public abstract void setBal(double bal);  public abstract void setType(java.lang.String type);  public abstract java.lang.String getId();  public abstract double getBal();  public abstract java.lang.String getType();  public void ejbLoad() {    /**@todo Complete this method*/  }  public void ejbStore() {    /**@todo Complete this method*/  }  public void ejbActivate() {    /**@todo Complete this method*/  }  public void ejbPassivate() {    /**@todo Complete this method*/  }  public void unsetEntityContext() {    this.entityContext = null;  }  public void setEntityContext(EntityContext entityContext) {    this.entityContext = entityContext;  }  public double deposit(double bal) {    /**@todo Complete this method*/    setBal(getBal() + bal);    return getBal();  }  public double withdraw(double account) {    /**@todo Complete this method*/    log("AccountBean.withdraw: Withdrawing $" + account + " from '" +                               getId() + "'");   if (account > getBal()) {        log("Request to withdraw $" + account +                               "; is more than balance $" + getBal() +                               " in account " + getId());   }   else      setBal(getBal() - account);   return getBal();  }  private void log(String s) {    System.out.println(s);  }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -