db.properties
id=007
name=\u5F20\u4E09
使用java读取db.properties中的值
public class Test02 {
public static void main(String[] args) {
Properties pro = new Properties();
try {
pro.load(Thread.currentThread().getContextClassLoader().getResourceAsStream("db.properties"));
} catch (IOException e) {
e.printStackTrace();
}
System.out.println(pro.getProperty("id"));
System.out.println(pro.getProperty("name"));
}
}