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

📄 startbankbean.java

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

import java.math.*;
import java.util.*;
import javax.ejb.*;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.rmi.PortableRemoteObject;

public class StartBankBean implements SessionBean{
  private SessionContext ctx;
  public void setSessionContext(SessionContext sc){
  	ctx=sc;
  }
  
  public String WelcomeCustomer(){
  	return "Hello Customer,Welcome!";
  }
  
  public Collection getSameLevelCustomer(int level){
  	Vector vectUserInfos = new Vector();
  	Collection collection = null;
		try {
			Context ctx = new InitialContext();
			Object ref = ctx.lookup("BankEJB");
			BankHome BankHome = (BankHome)
					PortableRemoteObject.narrow(ref,BankHome.class);
			collection = BankHome.findBankLevel(level);
		} catch(Exception e) {
			System.out.println("Failed get All same Level customers");			
		}
		return collection;
  }  
  
  public StartBankBean() {}
  public void ejbCreate() {}
  public void ejbRemove() {}
  public void ejbActivate() {}
  public void ejbPassivate() {}  
}

⌨️ 快捷键说明

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