文件位置:

文件内容:

代码:
public class Test{
public static void main (String[] args) throws IOException{
Properties pro = new Properties();
FileInputStream in =null;
try{
in = new FileInputStream("config\\db.properties");
}catch (FileNotFoundException e){
// TODO Auto-generated catch block
e.printStackTrace();
}
pro.load(in);
System.out.println (pro.getProperty ("driverName"));
//
}
}
原文:http://www.cnblogs.com/staryy/p/4243610.html