public class Sql {
public static void main(String[] args) {
initConfig();
}
public static void initConfig() {
InputStream inf = Sql.class.getClassLoader().getResourceAsStream("*/*/*/defalutDataSource.ini");
Properties properties = new Properties();
try {
properties.load(inf);
String classforName = properties.getProperty("defalutDataSource.connection.driver_class");
String sqlurl = properties.getProperty("defalutDataSource.connection.url");
String sqluser = properties.getProperty("defalutDataSource.connection.username");
String sqlpwd = properties.getProperty("defalutDataSource.connection.password");
System.out.println("classforName:"+classforName);
System.out.println("user:"+sqluser);
System.out.println("pwd:"+sqlpwd);
} catch (IOException e) {
System.out.println("读取配置文件失败");
}
}
}