Config 类

package com.empl.mgr.baseDao.util;

import java.io.IOException;

import java.io.InputStream;

import java.util.Properties;

public class Config {

private static Properties props = new Properties();

static {

ClassLoader loader = Config.class.getClassLoader();

InputStream in = loader.getResourceAsStream("config.properties");

try {

props.load(in);

} catch (IOException e) {

e.printStackTrace();

}

}

public static String getString(String key) {

return props.getProperty(key);

}

}

猜你喜欢

转载自luochaobin.iteye.com/blog/2391001