Hi,
Thanks for your reply, iam using JNDI lookup mechanism in my application, but coming to weblogic server, we need to pass some additional parameters to the
Context object.
Here is the below code.
-----------
Hashtable<Object,
String> ht = new Hashtable<Object, String>();
ht.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
ht.put(Context.PROVIDER_URL, "t3://localhost:80");
ht.put(Context.SECURITY_PRINCIPAL, "username");
ht.put(Context.SECURITY_CREDENTIALS, "password");
InitialContext ctx = new InitialContext(
ht);
DataSource newDataSource = (DataSource) ctx.lookup(serviceName);
conn = newDataSource.getConnection();
We need to pass an hashtable object as a parameter to the IntialContext object. Where as in
Tomcat server, this hashtable does not come into picture.