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

📄 accountssessions.java~16~

📁 一个四层结构的j2ee项目实例。对于初学者相当合适。欢迎下载使用。
💻 JAVA~16~
字号:
package sqlaccounts;/** * <p>Title: </p> * <p>Description: </p> * <p>Copyright: Copyright (c) 2002</p> * <p>Company: </p> * @author unascribed * @version 1.0 */import javax.ejb.*;import javax.naming.*;import javax.rmi.PortableRemoteObject;import java.rmi.RemoteException;import java.util.Collection;import java.util.Hashtable;import java.util.Properties;import java.util.Vector;import java.util.Iterator;import javax.ejb.CreateException;import javax.ejb.DuplicateKeyException;import javax.ejb.FinderException;import javax.ejb.ObjectNotFoundException;import javax.ejb.RemoveException;import javax.naming.Context;import javax.naming.InitialContext;import javax.naming.NamingException;import javax.rmi.PortableRemoteObject;public class AccountsSessions{   // private BorderLayout borderLayout1 = new BorderLayout();    private String sample = "Sample";    private String Type = "Sample";    private EjbAccountsHome ejbAccountsHome = null;    public AccountsSessions()    {        try        {            Context ctx = new InitialContext();            Object ref = ctx.lookup("EjbAccountsRemote");            this.ejbAccountsHome = (EjbAccountsHome)PortableRemoteObject.narrow(ref,EjbAccountsHome.class);        }        catch(Exception e)        {        }    }     public String getType()    {        return Type;    }    public void setType(String newType)    {        Type = newType;    }    public String getSample()   {       return sample;   }   public void setSample(String newSample)   {       sample = newSample;   }   public Vector findByType(String Type)   {       try       {           Collection AllejbAccounts = ejbAccountsHome.findByType(Type);           if (AllejbAccounts.isEmpty())               return null;           Iterator it = AllejbAccounts.iterator();           Vector all=new Vector();           while (it.hasNext()){               EjbAccounts ejbAccounts = (EjbAccounts)(javax.rmi.PortableRemoteObject.narrow(it.next(),EjbAccounts.class));               all.add(new AccountsSessions(ejbAccounts.getType()));           }           return all;       }catch(Exception e){           return null;       }   }   public AccountsSessions AccountsSessions(String type)   {       AccountsSessions accountsSessions=new AccountsSessions();       accountsSessions.setType(type);       return accountsSessions;   }}

⌨️ 快捷键说明

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