package mainTest;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
import java.util.ResourceBundle;
/**
* @author zhenggang
* @version Jul 16, 2008 3:56:00 PM
* comment
*/
public class TestProper {
public static void main(String[] args) {
ClassLoader cl = Thread.currentThread().getContextClassLoader();
InputStream is = cl.getResourceAsStream("jdbc.properties");
Properties props = new Properties();
try {
props.load(is);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
String str1 = props.getProperty("jdbc.url");
System.out.println(str1);
/* 方法二
* ResourceBundle bundle = ResourceBundle.getBundle("email");
String str2 = bundle.getString("setSubject");
System.out.println(str2);*/
}
}