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);

}

}

 

 

你可能感兴趣的:(java,Config)