public void connection5() throws Exception {
InputStream inputStream = Connection.class.getClassLoader().getResourceAsStream("D:\\StudentInfo\\src\\JDBCTest\\jdbc1.properties");
Properties pro = new Properties();
pro.load(inputStream);
this.user=pro.getProperty("user");
this.user=pro.getProperty("password");
this.user=pro.getProperty("driver");
this.user=pro.getProperty("url");
Class.forName(driver);//加载驱动
DriverManager.getConnection(url,user,password);
}
我直接用的是property文件的绝对路径但是最后返回的还是null不知道是为什么