InputStream inputStream = DBconn.class.getClassLoader().getResourceAsStream("/util/jdbc.properties");
怎么读取D盘下的.properties文件
File file= new File("D://xxxxxxxxxx");
InputStream in = new InputStream(new FileInputStream(file));
这里面的File你取D盘的绝对路径就行了
InputStream inputStream = DBconn.class.getClassLoader().getResourceAsStream("/util/jdbc.properties");
我建议你将.properties文件放到web项目下面。否则web项目打包后是无法使用的
直接读取配置文件就好了