How to point to jdni.properties file to set properties in Java
- by prosseek
I can use System.getProperties() method to set properties in Java.
System.getProperties().put("java.naming.factory.initial",
"fr.dyade.aaa.jndi2.client.NamingContextFactory");
System.getProperties().put("java.naming.factory.host", "localhost");
System.getProperties().put("java.naming.factory.port", "16400");
How can I get the same effect by reading the properties stored in a file?
When I have a jdni.properties with the following content:
java.naming.factory.initial fr.dyade.aaa.jndi2.client.NamingContextFactory
java.naming.factory.host localhost
java.naming.factory.port 16400
How can I teach Java to read them as properties?