Re: sun application server lookup jdbc resources



www.guanfenglin.com wrote:
Hello Guys,

I am a newbie in j2ee, I am having problem to lookup jdbc resources via
jndi...
I was able to find the EJBs I deployed, but not any jdbc resources.

here is my code
Properties p = new Properties();

p.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.cosnaming.CNCtxFactory");
p.put(Context.PROVIDER_URL, "iiop://localhost:23700");
InitialContext ic = new InitialContext(p);

NamingEnumeration enu = ic.list("");

while(enu.hasMore())
{
Binding b = (Binding) enu.next();
System.out.println(b.getName());
}

the output I have is:
SerialContextProvider
TravelEJB
ConverterEJB
GreeterEJB
ejb
OrderEJB

please help!!

The jdbc resources may be in a subcontext, something like java:comp/env/jdbc.

Mark
.



Relevant Pages

  • sun application server lookup jdbc resources
    ... I am a newbie in j2ee, I am having problem to lookup jdbc resources via ... I was able to find the EJBs I deployed, but not any jdbc resources. ... Binding b = enu.next; ...
    (comp.lang.java.help)
  • Re: sun application server lookup jdbc resources
    ... I am a newbie in j2ee, I am having problem to lookup jdbc resources via ... I was able to find the EJBs I deployed, but not any jdbc resources. ... Binding b = enu.next; ...
    (comp.lang.java.help)