📄 gouwuchebean.java
字号:
package JavaBean;
import ejb.*;
import java.util.Properties;
import javax.naming.*;
import java.util.*;
/**
* 远程调用sessionbean进行对表GouWuChe_Info操作
* <p>Title: </p>
*
* <p>Description: </p>
*
* <p>Copyright: Copyright (c) 2007</p>
*
* <p>Company: </p>
*
* @author not attributable
* @version 1.0
*/
public class GouWuCheBean {
Context ct;
GouWuCheSessionHome home;
boolean bool = false;
public GouWuCheBean() {
try {
ct = this.getInitialContext();
home = (GouWuCheSessionHome) ct.lookup("GouWuCheSession");
} 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 inster(String userCode, String number,
String name, String model, float price,
String count1) {
try{
GouWuCheSession rm=home.create();
bool=rm.inster(userCode,number,name,model,price,count1);
}catch(java.lang.Exception e){bool=false;e.printStackTrace();}
return bool;}
public boolean delete(String dingDanHao) {
try{
GouWuCheSession rm = home.create();
bool=rm.delete(dingDanHao);
}catch(java.lang.Exception e){bool=false;e.printStackTrace();}
return bool;}
public boolean xiugai(String dingDanHao, String userCode, String number,
String name, String model, float price,
String count1,String zhiFu) {
try{
GouWuCheSession rm = home.create();
bool=rm.xiugai(dingDanHao,userCode,number,name,model,price,count1,zhiFu);
}catch(java.lang.Exception e){bool=false;e.printStackTrace();}
return bool;}
public boolean querenzhifu(String dingDanHao) {
try{
GouWuCheSession rm = home.create();
bool=rm.querenzhifu(dingDanHao);
}catch(java.lang.Exception e){bool=false;e.printStackTrace();}
return bool;
}
public List selectAll(){
List list = new ArrayList();
try{
GouWuCheSession 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{
GouWuCheSession rm=home.create();
list=rm.selectForUserCode(code);
}catch(java.lang.Exception e){e.printStackTrace();}
return list;
}
public List selectForZhiFu() {
List list = new ArrayList();
try{
GouWuCheSession rm=home.create();
list=rm.selectForZhiFu();
}catch(java.lang.Exception e){e.printStackTrace();}
return list;
}
public List selectForDingDanHao(String dingDanHao) {
List list = new ArrayList();
try{
GouWuCheSession rm=home.create();
list=rm.selectForDingDanHao(dingDanHao);
}catch(java.lang.Exception e){e.printStackTrace();}
return list;}
public List selectForZhiFuORCode(String userCode) {
List list = new ArrayList();
try{
GouWuCheSession rm=home.create();
list=rm.selectForZhiFuORCode(userCode);
}catch(java.lang.Exception e){e.printStackTrace();}
return list;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -