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

📄 startstudentbean.java

📁 java的一系列产品中包括jsme,jmse,j2ee,本文件提供j2ee实现的源代码.
💻 JAVA
字号:
package sessionEntity;

import javax.ejb.SessionBean;
import javax.ejb.SessionContext;
import java.math.*;

public class StartStudentBean implements SessionBean{
  private SessionContext ctx;
  public void setSessionContext(SessionContext sc){
  	ctx=sc;
  }
  
  public String HelloStudent(){
  	return "Hello StartStudent,Welcome!";
  }
  
  public Collection getAllStudents(int grade){
  	Vector vectUserInfos = new Vector();
		try {
			Context ctx = new InitialContext();
			Object ref = ctx.lookup("StudentHome");
			StudentHome studentHome = (StudentHome)
			PortableRemoteObject.narrow(ref,StudentHome.class);
			Collection collection = studentHome.findStudentsInGrade(grade);
			Return collection;
		} catch(Exception e) {
			System.out.println("failed get All Students");
			//e.printStackTrace();
		}
  }  
  
  public HelloEJBBean() {}
  public void ejbCreate() {}
  public void ejbRemove() {}
  public void ejbActivate() {}
  public void ejbPassivate() {}  
}

⌨️ 快捷键说明

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