📄 productsecbean.java~2~
字号:
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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -