EJB会话 bean实体 bean之间访问 。。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 import java.rmi.RemoteException;import java.security.Identity;import java.util.Properties;import javax.ejb.*;import com.ibm.uxo.bestpractices.datamodels.*;public class EmployeeRosterBean implements SessionBean {private EmployeeHome employeeHome;private javax.ejb.SessionContext mySessionCtx = null;final static long serialVersionUID = 3206093459760846163L;public void ejbCreate() throws javax.ejb.CreateException,java.rmi.RemoteException {employeeHome = EmployeeEjbHomeCacheHelper.getEmployeeHome()}public EmployeeStruct getEmployeeInfoFor(String empno) {Employee theEmployee = null;EmployeeStructure returnValue = new EmployeeStructure();try {theEmployee = employeeFindByPrimaryKey(new EmployeeKey(empno));returnValue.setSex(theEmployee.getSex());returnValue.setSalary(theEmployee.getSalary());returnValue.setPhoneno(theEmployee.getPhoneno());returnValue.setMidinit(theEmployee.getMidinit());returnValue.setLastname(theEmployee.getLastname());returnValue.setJob(theEmployee.getJob());returnValue.setHiredate(theEmployee.getHiredate());returnValue.setFirstnme(theEmployee.getFirstnme());returnValue.setEmpno(empno);returnValue.setEdlevel(theEmployee.getEdlevel());returnValue.setComm(theEmployee.getComm());returnValue.setBonus(theEmployee.getBonus());returnValue.setBirthdate(theEmployee.getBirthdate());returnValue.setWorkDept(theEmployee.getWorkdept());} catch (Exception e) {e.printStackTrace();}return returnValue;}public void ejbActivate() throws java.rmi.RemoteException {}public void ejbPassivate() throws java.rmi.RemoteException {}public voide ejbRemove() throws java.rmi.RemoteException {}} 有个超级好帖子:http://www.sun.com/bigadmin/hubs/multilingual/simp_chinese/content/TechTips_Feb07.jsp 今天看了下无状态和有状态的session bean 实在是看天书,到底EJB的存在是为了解决什么问题 ?? spring做管理,hibernate做取数据,那么ejb做什么呢 ?? 我看了那个佛山人的PDF,也许正因为存在着无状态的session bean,好处就是可以在节约系统内存的前提上加入存取数据和界面之间,他的作用是在存取数据中节约开销,我的理解对么?? Remote 与Local 接口是什么,有什么区别 ? 谁知道的麻烦说下,谢谢 !!! 关于STRUTS1的表单提交 申明新变量调用一个集合,赋值后为什么改变了原来集合的值? ant打包问题 java比例截图 要无锯齿的 请赐教 JAVA中取得所有txt的正则表达式问题 Hibernate 分页是执行query.list(); 报数组下标越界 急。怀疑标示increment有关 我在xfire与spring结合报错为什么? 求: 李兴华讲解的Hibernate 需要指点,tomcat5里jsp调用javabean出现错误 iReport-5.6.0打不开如何破 前辈们,帮我看一下简历吧,哪里还需要完善一下,谢谢。。。 在jsp页面中怎样设置fckeditor编辑的属性?
import java.security.Identity;
import java.util.Properties;
import javax.ejb.*;
import com.ibm.uxo.bestpractices.datamodels.*;public class EmployeeRosterBean implements SessionBean {
private EmployeeHome employeeHome;
private javax.ejb.SessionContext mySessionCtx = null;
final static long serialVersionUID = 3206093459760846163L;public void ejbCreate() throws javax.ejb.CreateException,
java.rmi.RemoteException {
employeeHome = EmployeeEjbHomeCacheHelper.getEmployeeHome()}public EmployeeStruct getEmployeeInfoFor(String empno) {
Employee theEmployee = null;
EmployeeStructure returnValue = new EmployeeStructure();try {
theEmployee = employeeFindByPrimaryKey(new EmployeeKey(empno));returnValue.setSex(theEmployee.getSex());
returnValue.setSalary(theEmployee.getSalary());
returnValue.setPhoneno(theEmployee.getPhoneno());
returnValue.setMidinit(theEmployee.getMidinit());
returnValue.setLastname(theEmployee.getLastname());
returnValue.setJob(theEmployee.getJob());
returnValue.setHiredate(theEmployee.getHiredate());
returnValue.setFirstnme(theEmployee.getFirstnme());
returnValue.setEmpno(empno);
returnValue.setEdlevel(theEmployee.getEdlevel());
returnValue.setComm(theEmployee.getComm());
returnValue.setBonus(theEmployee.getBonus());
returnValue.setBirthdate(theEmployee.getBirthdate());
returnValue.setWorkDept(theEmployee.getWorkdept());
} catch (Exception e) {
e.printStackTrace();
}
return returnValue;
}public void ejbActivate() throws java.rmi.RemoteException {}
public void ejbPassivate() throws java.rmi.RemoteException {}
public voide ejbRemove() throws java.rmi.RemoteException {}
}
http://www.sun.com/bigadmin/hubs/multilingual/simp_chinese/content/TechTips_Feb07.jsp
实在是看天书,到底EJB的存在是为了解决什么问题 ??
spring做管理,hibernate做取数据,那么ejb做什么呢 ??
我看了那个佛山人的PDF,也许正因为存在着无状态的session bean,好处就是可以在节约系统内存的前提上加入存取数据和界面之间,他的作用是在存取数据中节约开销,我的理解对么??
Remote 与Local 接口是什么,有什么区别 ?
谁知道的麻烦说下,谢谢 !!!