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

📄 client3.java~12~

📁 郭克华j2ee高级框架实战教学视频源代码 这个是比较值得一看的 由郭克华博士在总结多年Java培训的基础上
💻 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 + -