package TestDemo;
import java.io.IOException;
import java.io.InputStream;
import java.sql.Connection;
import java.util.Properties;
public class Test_0523 {
private String hostname = "127.0.0.1";
public void getConnection (){
Properties pr = new Properties();
InputStream in = Test_0523.class.getClassLoader().getResourceAsStream( "TestDemo/jdbc.properties");
try {
pr.load(in);
String url = pr.getProperty("url");
System.out.println(url);
String hosts = pr.getProperty("hosts");
String [] hostss = hosts.split(" ");
for (String i : hostss) {
System.out.println("ping" +" "+ i);
}
} catch (IOException e) {
// TODO 自动生成的 catch 块
e.printStackTrace();
}
}
public static void main (String []args){
Test_0523 ts = new Test_0523();
ts.getConnection();
}
}