错误/异常:java.io.FileNotFoundException: .\src\db.properties (系统找不到指定的路径。);的解决方法
1、错误/异常图 2、解决方法 与之相关的部分代码: 1 static { 2 try { 3 // 读取db.properties 4 Properties props = new Properties(); 5 FileInputStream in = new FileInputStream("./src/db.properties"); 6 // 加载文件 7 props.load(in); 8 url = props.getProperty("url" ); 9 user = props.getProperty("user" ); 10 password = props.getProperty("password" ); 11 driverClass = props.getProperty("driverClass" ); 12 // 注册驱动 13 Class.forName(driverClass); 14 } catch (FileNotFoundException e) { 15 e.printStackTrace(); 16 } catch (IOException e) { 17 // TODO Auto-generated catch block 18 e.printStackTrace(); 19 } catch