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

📄 constants.java

📁 EJB3.0-Book实例教程配套资源.
💻 JAVA
字号:
package com.foshanshop.conf;
import java.util.Properties;
import javax.naming.InitialContext;

public class Constants {
    private static InitialContext ctx = null;
    
    public static InitialContext getInitialContext() {
        if (ctx!=null){
            return ctx;
        }else{            
            try {
                Properties props = new Properties();
                props.load(Thread.currentThread().getContextClassLoader().getResourceAsStream("jndi.properties"));
                ctx = new InitialContext(props);
            } catch (Exception e) {
                ctx = null;
            }            
            return ctx;
        }     
    }
}

⌨️ 快捷键说明

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