I was wonder, with
the default installation of JBOSS, what is the jndi factory lookup for a
datasource, the url, username and the password.
E.G. for
Weblogic:
private
Context getInitialContext(){
Properties properties = null;
Context ctx =null;
Context ctx =null;
String
weblogic_url="t3://localhost:7001";
String
weblogic_jndi_factory_name="weblogic.jndi.WLInitialContextFactory";
String
user="system";
String
pass="password";
try {
properties = new Properties();
properties.put(Context.INITIAL_CONTEXT_FACTORY, weblogic_jndi_factory_name);
properties.put(Context.PROVIDER_URL, weblogic_url);
if (user != null) {
properties.put(Context.SECURITY_PRINCIPAL, user);
properties.put(Context.SECURITY_CREDENTIALS, pass == null ? "" : pass);
}
ctx= new InitialContext(properties);
}
catch (javax.naming.NamingException e) {
logger.error("Unable to connect to WebLogic server at " + weblogic_url);
}
return ctx;
}
Thanks