我有一个项目组织了这个:
-LIBRERIA CLIENT/
-SRC/
-CONNECTION/
CONNECTIONdB.JAVA
CONFIG.PROPERTIES
在CONNECETIONDB
我有这个代码来读取CONFIG.PROPERTIES
文件:
public static void connect() throws RemoteException
{
//read file config.properties:
String dbHost="",dbUser="",dbPassword="";
Properties prop=new Properties();
try
{
//load il file:
prop.load(new FileInputStream("src/Connectionconfig.properties"));
//read the property of file
dbHost=prop.getProperty("host");
dbUser=prop.getProperty("user");
dbPassword=prop.getProperty("password");
}catch(FileNotFoundException fe){
System.out.println("File not found");
}catch(IOException ex){
System.out.println("Error reading configuration file");
}
但我有这个错误:
FILE NOT FOUND
有人能告诉我我哪里出错了吗?