4 Replies Latest reply on Feb 12, 2007 1:42 PM by 807606

    "jdbc/SchoolDataSource"  is it a jndi name ?

      code snippet from the entity bean

      DataSource ds =(DataSource)ic.lookup(�java:comp/env/jdbc/SchoolDataSource�);

      "jdbc/SchoolDataSource" is it a jndi name ?
        • 1. Re: "jdbc/SchoolDataSource"  is it a jndi name ?
          because i have the followings


          <description>The reference to the


          • 2. Re: "jdbc/SchoolDataSource"  is it a jndi name ?
            Yes, yes it is.

            Since you're doing a JNDI lookup, it's most certainly a JNDI name.
            • 3. Re: "jdbc/SchoolDataSource"  is it a jndi name ?
              thats what i knew . but my understanding becomes dull when i found "jdbc/SchoolDataSource" comes under a tag <res-ref-name> not <jndi-name>

              so, this lookup method is looking up <res-ref-name> then ....not the actual jndi name "SchoolDataSource" (in weblogic-ejb-jar.xml) though they have a reference.

              is not the context lookup method really searches for the real JNDI name ?

              or whats the reason to make a 3 level reference that way ?
              • 4. Re: "jdbc/SchoolDataSource"  is it a jndi name ?
                The terminology is rather confusing in the documentation.

                I'd describe "java:comp/jdc/env/SchoolDataSource" as a URL, not a name. Even "jdbc/SchoolDataSource" is a path, not a name.

                When you do an initial context lookup you need the full URL, but some of the configuration attributes abreviate it, since they assume that all the URLs start with java:comp/env.

                Just to make it more irritating some kinds of OC4J resource apparently have to start java:comp/resource