File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Problem using JNDI to a Oracle database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Problem using JNDI to a Oracle database" Watch "Problem using JNDI to a Oracle database" New topic
Author

Problem using JNDI to a Oracle database

Helaman Castillo
Greenhorn

Joined: Mar 03, 2003
Posts: 2
Currently I am using JNDI with DB2. I am now trying to use JNDI with Oracle in my Service Locator. What changes do I have to make to my code, more specifically what is the INITIAL_CONTEXT_FACTORY?
//here is the current code with DB2
java.util.Hashtable properties = new java.util.Hashtable(2);
properties.put(javax.naming.Context.PROVIDER_URL, "iiop:///"); // local name server
properties.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY,
"com.ibm.ejs.ns.jndi.CNInitialContextFactory"); // IBM name services
initContext = new javax.naming.InitialContext(properties);
Object obj = initContext.lookup("jta/usertransaction");
userTran = (UserTransaction)javax.rmi.PortableRemoteObject.narrow(obj, UserTransaction.class);
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem using JNDI to a Oracle database
 
Similar Threads
Datasource Lookup from WSAD using POJO - CastException looking up DB2
access ejb from weblogic; ejb is deployed in websphere
Running Servlets in Weblogic
Error in accessing EJB from Client...
Distributed Transactions