1 Reply Latest reply: Mar 29, 2013 3:06 AM by 997468 RSS

    Datasource lookup settings

    990435
      Hi,

      I'm trying to connect to my datasource which I've configured in weblogic, but something goes wrong, any help out there? Im i doing the jndi-name/res-ref-name right??
      Name: fiskDS
      JNDI Name: jdbc/fisk
      Type: Gridlink

      >
      DataSource dataSource = (DataSource) context
      .lookup("*java:comp/env/jdbc/fisk*");
      >

      weblogic.xml
      <weblogic-web-app>
      <container-descriptor>
      <prefer-web-inf-classes>true</prefer-web-inf-classes>
      </container-descriptor>
      <resource-description>
      *<jndi-name>* fiskDS</jndi-name>
      *<res-ref-name>* jdbc/fisk</res-ref-name>
      </resource-description>
      </weblogic-web-app>
      >

      web.xml
      <resource-ref>
      <description>Play Datasource for testDatasource</description>
      *<res-ref-name>* jdbc/fisk</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
      </resource-ref>
        • 1. Re: Datasource lookup settings
          997468
          Hi,

          Configuration seems to be incorrect here.

          Tag *<jndi-name></jndi-name>* is used to add JNDI name configured in server (WLS) i.e, JNDI visible from admin console under datasource which for you will be jdbc/fisk. And tag *<res-ref-name></res-ref-name>* is used to add EJB resource name which will be used by application to map with server datasource JNDI name.

          Thanks,
          Ranjan