java读取配置文件

InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream("jdbc.properties");
Properties p = new Properties();
try {
p.load(inputStream);
} catch (IOException e1) {
e1.printStackTrace();
}
System.out.println("ip:"+p.getProperty("jdbc.password"));

posted on 2015-07-29 13:53  zhaoshuzhan  阅读(102)  评论(0编辑  收藏  举报

导航