Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem using JNDI to a Oracle database

 
Helaman Castillo
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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);
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic