📄 client3.java~12~
字号:
package client;
import javax.rmi.PortableRemoteObject;
import prj32_1.CustomerBmpRemoteHome;
import prj32_1.CustomerBmpRemote;
/*
*/
public class Client3 {
public static void main(String args[]) throws Exception{
Object obj = EjbFactory.getEjbHome("CustomerBmp");
CustomerBmpRemoteHome home = (CustomerBmpRemoteHome) PortableRemoteObject.
narrow(obj, CustomerBmpRemoteHome.class);
//查询1
CustomerBmpRemote remote1 = home.findByPrimaryKey("0008");//0008载入这个Bean
remote1.getAccount();//到达了准备状态
//查询2
CustomerBmpRemote remote2 = home.findByPrimaryKey("0008");//0009载入这个Bean,覆盖掉0008,但是0008是被保存在context中,可以通过ejbActivate来得到
remote2.getAccount();//此时不是用的
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -