view plainprint?
package com
import java
import java
import java
import org
/**
* @use Java普通類實現裝載配置文件
* @author Bird
*
*/
public class UserDao {
@Test//無法實現動態修改後呈現
public void update() throws Exception{
InputStream in = UserDao
Properties pro = new Properties();
pro
String url = pro
String username = pro
String password = pro
System
System
System
}
@Test//可以時時的獲得更改後的數據
public void test() throws Exception{
String path = UserDao
FileInputStream in = new FileInputStream(path);
Properties pro = new Properties();
pro
String url = pro
String username = pro
String password = pro
System
System
System
}
}
From:http://tw.wingwit.com/Article/program/Java/hx/201311/26445.html