ClientDataModule.java~21~
上传用户:jnhyscl
上传日期:2010-03-08
资源大小:345k
文件大小:2k
- package dm;
- /**
- * <p>Title: </p>
- * <p>Description: </p>
- * <p>Copyright: Copyright (c) 2003</p>
- * <p>Company: </p>
- * @author not attributable
- * @version 1.0
- */
- import shiponline.*;
- import com.borland.dx.dataset.*;
- import com.borland.dx.ejb.*;
- public class ClientDataModule implements DataModule {
- private static ClientDataModule myDM;
- SessionBeanConnection sessionBeanConnection = new SessionBeanConnection();
- EjbClientDataSet portDataSet = new EjbClientDataSet();
- ParameterRow portIdParameter = new ParameterRow();
- Column searchItemColumn = new Column();
- Column priceColumn = new Column();
- Column ejbPrimaryKeyColumn = new Column();
- Apps apps;
- public ClientDataModule() {
- try {
- System.out.println("hhhhhhhhhhhhhh" + sessionBeanConnection.toString());
- jbInit();
- }
- catch(Exception e) {
- e.printStackTrace();
- }
- }
- private void jbInit() {
- try{
- portDataSet.setSessionBeanConnection(sessionBeanConnection);
- portDataSet.setExecuteOnOpen(false);
- // portDataSet.setMethodName("Port");
- apps = (Apps) sessionBeanConnection.getSessionBeanRemote();
- portIdParameter.setColumns(new Column [] { new Column("PORTID", "PORTID", Variant.INT)});
- //portDataSet.setParameterRow(portIdParameter);
- if(!portDataSet.isOpen()){
- portDataSet.open();
- }else{
- portDataSet.empty();
- }
- }catch(Exception e) {
- System.out.println("gggggggggggggggggggg" + e);
- }
- }
- public static ClientDataModule getDataModule() {
- if (myDM == null) {
- myDM = new ClientDataModule();
- }
- return myDM;
- }
- public com.borland.dx.ejb.SessionBeanConnection getSessionBeanConnection() {
- return sessionBeanConnection;
- }
- public void setPortDataSet(EjbClientDataSet ds){
- this.portDataSet=ds;
- }
- public EjbClientDataSet getPortDataSet() {
- return portDataSet;
- }
- public void addNewPort() throws Exception{
- DataSetData[] ds = apps.addNewPort();
- //ds[0].loadDataSet(this.portDataSet);
- }
- }