// 取得属性文件中
private Map<String, String> getPropertiesMap() {
Properties properties = new Properties();
try {
properties.load(this.getClass().getClassLoader()
.getResourceAsStream("jdbc.properties"));
alertConfigMap.put("jdbc.url", properties.getProperty("jdbc.url"));
alertConfigMap.put("jdbc.url.3d", properties.getProperty("jdbc.url.3d"));
alertConfigMap.put("jdbc.username", properties.getProperty("jdbc.username"));
alertConfigMap.put("jdbc.password", properties.getProperty("jdbc.password"));
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return alertConfigMap;
}
操作属性文件
最新推荐文章于 2016-11-24 23:13:21 发布