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

📄 jndicustomfactoryappclient.java

📁 一个java写的加密算法
💻 JAVA
字号:
/* * Copyright 2004-2005 Sun Microsystems, Inc.  All rights reserved. * Use is subject to license terms. *//* * @author amurillo */package samples.jndi.custom.client;import java.io.*;import java.util.*;import javax.ejb.EJBHome;import javax.naming.*;import samples.jndi.custom.share.*;public class JndiCustomFactoryAppClient {    public static void main (String[] args)     {        try        {            Context    initCtx = new InitialContext();                //Context    envCtx  = (Context) initCtx.lookup("java:comp/env");            //CustomBean bean    = (CustomBean) envCtx.lookup("bean/CustomBean");                        CustomBean bean    = (CustomBean) initCtx.lookup("bean/CustomBean");            System.out.println("PropertyOne = "   + bean.getPropertyOne() +                                ", PropertyTwo = " + bean.getPropertyTwo());        } catch (NameNotFoundException e) {             System.out.println("Name <bean/customBean> not found.");            System.out.println("Try asant create-custom-resource before runnng the application");        } catch (Exception e) {             System.out.println("Caught Exception");            e.printStackTrace();        }    }}

⌨️ 快捷键说明

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