Properties文件读取

public class Test {

public static void main(String[] args) throws IOException {
InputStream in = Test.class.getClassLoader().getResourceAsStream("DB.properties");
Properties prop = new Properties();
prop.load(in);
System.out.println(prop.get("driverClass"));
}
}

posted @ 2016-06-12 09:29  N神3  阅读(121)  评论(0编辑  收藏  举报