File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes Connecting to MOM using propertries files Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Reply Bookmark "Connecting to MOM using propertries files" Watch "Connecting to MOM using propertries files" New topic
Author

Connecting to MOM using propertries files

Patrick ODonnell
Ranch Hand

Joined: Nov 28, 2001
Posts: 31
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
Kyle Brown
author
Ranch Hand

Joined: Aug 10, 2001
Posts: 3879
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


Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at http://www.kyle-brown.com/ for other WebSphere information.
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
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.


Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Connecting to MOM using propertries files
 
Similar Threads
File Upload
copy workbook(xls) using xls
accessing EJB from java client Error!
Files in jsp
DOM Parsing - Please help