posted 13 years ago
Well..I was able to identify the port number in the following manner:
FROM WAS ADMIN CONSOLE: SERVERS -> APPLICATION SERVERS -> Under Communications -> Expand Ports
Now, I am getting an other error when I am trying to get the connection:
Properties prop = new Properties();
prop.put(Context.INITIAL_CONTEXT_FACTORY,"com.ibm.websphere.naming.WsnInitialContextFactory");
prop.put(Context.PROVIDER_URL,"iiop://localhost:2811");
InitialContext init = new InitialContext(prop);
DataSource ds = (DataSource) init.lookup("jdbc/testDS");
//Connection conn = ds.getConnection("USER NAME","PASSWORD");
Connection conn = ds.getConnection();
If, I give the username/pwd while retrieving the connection it is working but it is not working if i don't give them. Since, I am thinking that it is not possible to get data source of websphere externally without authentication. But I guess setting up the authentication alias will be able to solve the problem. I tried it to but no luck.
Please, let me know if anybody has any information in retrieving the data source through custom properties/authentication alias ??
Thanks.