java读取.properties

public void test(){
InputStream ips=this.getClass().getResourceAsStream("/oracle.properties");
Properties properties=new Properties();
try {
properties.load(ips);
System.out.println(properties.getProperty("jdbc.url"));

} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}

你可能感兴趣的:(properties)