Hi, I want to read property file on Server side. I have DBConfig.java, useDBConfig.java and DBConfig.properties all placed in server package. I can't read the values from property file on Server Side. Your help is highly appreciated. Thanks in advance.
Thanks Salvin Fancis, I am trying to read the properties file to read database related information at server side. You are right I shouldn't place it on client side. Could you please let me know how should I read properties file.
I also used this technique... but It doesn't read the file.
BufferedInputStream stream = new BufferedInputStream(DBSettings.getClass().getResourceAsStream("DBConfig.properties"));
Properties prop = new Properties();
prop.load(new FileInputStream("DBConfig.properties")); //prop.load gives error
posted 5 years ago
It can't read the file. I have written this code in servlet and and put the DBConfig.properties file inside it. I also tried putting the same file in WAR and META-INF directory as well. I would highly appreciate your support.