⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 adminsession.java~21~

📁 一个J2EE四层架构的实例
💻 JAVA~21~
字号:
package sqlaccounts;import javax.naming.*;import javax.rmi.PortableRemoteObject;import java.util.Collection;/** * <p>Title: </p> * <p>Description: </p> * <p>Copyright: Copyright (c) 2002</p> * <p>Company: </p> * @author unascribed * @version 1.0 */public class AdminSession {  private Login loginer;  private String type;  private double bal;  private  String Id;  public  Collection   conType;  public AdminSession()  {    try{      Context ctx = new InitialContext();      LoginHome home = (LoginHome)javax.rmi.PortableRemoteObject.narrow(ctx.lookup("Login"),LoginHome.class);      loginer = home.create();    }catch(Exception e){      System.out.println(e);    }  }  private void log(String s)  {    System.out.println(s);  }  public boolean login(String Id){    try{      return loginer.login(Id);    }catch(Exception e){      return false;    }  }  public boolean AddAmount(String id, String Type, double bal)  {    /**@todo Complete this method*/    try    {      return loginer.AddId(id, Type, bal);    }    catch(Exception e)    {      return false;    }  }  public boolean findByType(String Type)  {   try   {     conType=loginer.findByType(Type);     return true;    }    catch(Exception e)    {     return false;    }  }  public boolean findOrCreateAccount(String id,  String accountType,double balance)  {    try    {      return loginer.findOrCreateAccount(id,  accountType,balance);    }    catch (Exception onfe)    {      return false;    }  }  public void setId(String id)  {    this.Id =id;  }  public String getId()  {    return Id;  }  public void setBal(double bal)  {    this.bal=bal;  }  public double getBal()  {    return bal;  }  public void setType(String type)  {    this.type=type;  }  public String getType()  {    return type;  }}

⌨️ 快捷键说明

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