📄 40a5b8ce31410018187e8f4f0cfd5be6
字号:
package Dao;
import java.util.*;
import java.io.*;
import org.
import org.logicalcobwebs.proxool.configuration.PropertyConfigurator;
public final class Env{
private static Env instance;
public static Env getInstance()
{
if(instance != null)
{
return instance;
}
else
{
makeInstance();
return instance;
}
}
public static synchronized void makeInstance()
{
if(instance == null)
{
instance = new Env();
}
}
private Env()
{
Properties p = new Properties();
InputStream is = getClass().getResourceAsStream("db.properties");
try
{
p.load(is);
PropertyConfigurator.configure(p);
}catch(Exception e)
{
System.out.println("错误:没有读取属性文件,请确认db.properties文件是否存在");
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -