📄 constants.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 + -