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

📄 lookup.java

📁 在JAVA编程中对JNDI的支持.是一个开放的源码.
💻 JAVA
字号:
/* * Copyright (c) 1997.  Sun Microsystems. All rights reserved. * * Example program that looks up the object bound to a name. *     java Lookup <name_of_object> */import javax.naming.*;import java.util.Properties;class Lookup {    public static void main(String[] args) {        if (args.length < 1) {	    System.err.println("usage: java Lookup <name_of_object>");	    System.exit(-1);	}	// Retrieve any jndi environment properties from system properties.	// 	// This approach of using system properties here is for	// expediency only and not meant to be prescriptive.  This is	// only one of the many ways to set up environment properties.	Properties env = System.getProperties();	try {	    Context ctx = new InitialContext(env);	    System.out.println(ctx.lookup(args[0]));	} catch (Exception e) {	    e.printStackTrace();	}    }}

⌨️ 快捷键说明

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