productsecbean.java~2~

来自「这也是师兄的毕业设计,具体的功能我也不清楚,因为我才大一,请见谅!!!!!!!不」· JAVA~2~ 代码 · 共 58 行

JAVA~2~
58
字号
package product;

import javax.ejb.*;
import javax.naming.*;
import java.rmi.*;
import javax.rmi.PortableRemoteObject;
import java.util.*;
import java.awt.Image;


public class productSecBean implements SessionBean {
  SessionContext sessionContext;
  public void ejbRemove() {
    /**@todo Complete this method*/
  }
  public void ejbActivate() {
    /**@todo Complete this method*/
  }
  public void ejbPassivate() {
    /**@todo Complete this method*/
  }
  public void setSessionContext(SessionContext sessionContext) {
    this.sessionContext = sessionContext;
  }
  public void ejbCreate() throws CreateException {
    /**@todo Complete this method*/
  }

  //用于返回一个远程引用
  public productBasicInfoEntRemoteHome remoteReference(){
   productBasicInfoEntRemoteHome home=null;
    try{

      Context ctx = new InitialContext(System.getProperties());
      home = (productBasicInfoEntRemoteHome) PortableRemoteObject.narrow(
              ctx.lookup("productBasicInfoEntRemote"), productBasicInfoEntRemoteHome.class);
    }
    catch(Exception e){System.out.println("查找 productBasicInfoEntRemoteHome bean 时有异常: "+e);}

      return home;

  }


  public java.util.Collection findbyprimarykey(String p_id) {
    /**@todo Complete this method*/
    return null;
  }
  public void insertNewProduct(String p_id, String p_type_id, String p_name, String p_spec, String p_model, String p_unit, Image p_image, String p_remark) {
    /**@todo Complete this method*/
   try{
      productBasicInfoEntRemoteHome home = remoteReference();
      home.create(p_id, p_type_id, p_name, p_spec, p_model, p_unit, p_image,
                  p_remark);
    }
    catch(Exception e){System.out.println("插入 new product 时有异常: "+e);}
  }
}

⌨️ 快捷键说明

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