我试图读取config.properties文件,但是我收到此错误:“发生异常:java.io.FileNotFoundException”
我正在使用此代码:
Properties config = new Properties();
InputStream configInput = null;
private Connection getDBConnection() {
try{
configInput = new FileInputStream("config.properties");
config.load(configInput);
} catch(Exception e){
System.out.println(config.getProperty("Error en archivo propiedades" + e.getMessage()));
}
Connection dbConnection = null;
try {
Class.forName(config.getProperty("DRIVER"));
} catch (ClassNotFoundException e) {
System.out.println(e.getMessage());
}
........ continue
我在同一个包中有class和config属性: click go to complete process