?? fahuobean.java~11~
字號:
package JavaBean;
import ejb.*;
import java.util.Properties;
import javax.naming.*;
import java.util.*;
import ejb.FahuojiluVo;
/**
* /**
* 遠程調用sessionbean進行對表Fahuojilu操作
*/
* <p>Title: </p>
*
* <p>Description: </p>
*
* <p>Copyright: Copyright (c) 2007</p>
*
* <p>Company: </p>
*
* @author not attributable
* @version 1.0
*/
public class FaHuoBean {
Context ct;
FahuojiluSessionHome home;
boolean bool = false;
public FaHuoBean() {
try {
ct = this.getInitialContext();
home = (FahuojiluSessionHome) ct.lookup("FahuojiluSession");
} catch (Exception e) {
e.printStackTrace();
}
}
public Context getInitialContext() throws Exception {
String url = "t3://localhost:7001";
String user = null;
String password = null;
Properties properties;
try {
properties = new Properties();
properties.put(Context.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");
properties.put(Context.PROVIDER_URL, url);
if (user != null) {
properties.put(Context.SECURITY_PRINCIPAL, user);
properties.put(Context.SECURITY_CREDENTIALS,
password == null ? "" : password);
}
return new javax.naming.InitialContext(properties);
} catch (Exception e) {
throw e;
}
}
public boolean delete(String dingDanHao) {
try{
FahuojiluSession rm = home.create();
bool=rm.delete(dingDanHao);
}catch(java.lang.Exception e){bool=false;e.printStackTrace();}
return bool;}
public List selectAll(){
List list = new ArrayList();
try{
FahuojiluSession rm=home.create();
list=rm.selectAll();
}catch(java.lang.Exception e){e.printStackTrace();}
return list;
}
public List selectForUserCode(String code) {
List list = new ArrayList();
try{
FahuojiluSession rm=home.create();
list=rm.selectForUserCode(code);
}catch(java.lang.Exception e){e.printStackTrace();}
return list;
}
public List selectForDingDanHao(String dingDanHao) {
List list = new ArrayList();
try{
FahuojiluSession rm=home.create();
list=rm.selectForDingDanHao(dingDanHao);
}catch(java.lang.Exception e){e.printStackTrace();}
return list;}
public boolean inster(String dingDanHao, String userCode, String number,
String name, String model, float price, String count1,
String zhiFu) {
try{
FahuojiluSession rm=home.create();
bool=rm.inster(dingDanHao,userCode,number,name,model,price,count1,zhiFu);
}catch(java.lang.Exception e){bool=false;e.printStackTrace();}
return bool;}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -