Hi all, I'm am trying to connect to MQSereis and SonicMQ using a Java Application I have written. The way you specify the JNDI initial context differ slightly Between. Is possible to load these from a properties file?? And if so how is this done as I don't know much about property files?? Thanks, Patrick
Joined: Aug 10, 2001
Read the Javadoc on java.lang.Properties. It's really pretty easy -- a Properties can be read from a text file with the format key=value... Kyle
The Properties class has a load() method that can read an InputStream. So you can create a FileInputStream and use it as the parameter for the load. At that point you can treat the Properties object the same way you treat a Hashtable to get the value when you specify a key.