1 Reply Latest reply on Jun 16, 2003 8:34 AM by kenci

    db2 datasource problem: cannot find table

    xyw3

      I'm trying to use datasoruce with DB2 7.2 and JBoss 3.0.6, the problem is:

      the connection returned is not null (org.jboss.resource.adapter.jdbc.local.LocalConnection@1ddcac5), but the tables cannot be found. Seemed the connection is directed to the hsqldb, but not DB2. Anyone can help?

      By the way, do I need to add anything to the jboss-web.xml and web.xml files? In the ejb-jar.xml, what should be filled in the following:

      <resource-ref>
      <res-ref-name>???</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
      </resource-ref>

      and what for the following in jboss.xml:
      <resource-ref>
      <res-ref-name>???</res-ref-name>
      <resource-name>???</resource-name>
      </resource-ref>

      <resource-managers>
      <resource-manager>
      <res-name>???</res-name>
      <res-jndi-name>???</res-jndi-name>
      </resource-manager>
      </resource-managers>

      What should the above areas correspond to those in the db2-service.xml file?

      Thanks for any help.

        • 1. Re: db2 datasource problem: cannot find table
          kenci

          Dont no much about DB2 but these setting should be the same

          The <res-ref-name> is the name as referenced in your java code e.g in Java Code "java:comp/env/jdbc/[name]"
          in ejb-jar.xml: <res-ref-name>jdbc/[name]</res-ref-name>

          <resource-ref>
          <res-ref-name>jdbc/[name]</res-ref-name>
          <res-type>javax.sql.DataSource</res-type>
          <res-auth>Container</res-auth>
          </resource-ref>


          In the jboss.xml you need to match the <res-ref-name> in this file to the one in the ejb-jar.xml so this should be: <res-ref-name>jdbc/[name]</res-ref-name>.

          I di not use r<resource-name> instead I had <jndi-name> which should start java:/[name]
          <jndi-name>java:/[name]</jndi-name>

          and what for the following in jboss.xml:
          <resource-ref>
          <res-ref-name>jdbc/[name]</res-ref-name><resource-name>???</resource-name>
          </resource-ref>

          The resource Managers can be the same as above for both res-name and res-jndi-name same as res-ref-name and res-jndi-name same as jndi-name above

          <resource-managers>
          <resource-manager>
          <res-name>jdbc/[name]</</res-name>
          <res-jndi-name>java:/[name]</</res-jndi-name>

          </resource-manager>
          </resource-managers>

          What should the above areas correspond to those in the db2-service.xml file?

          Thanks for any help.

          The <res-jndi-name>should correspond to the jndi-name or eqivalent in db2- service.xml minus the java:/
          so the jndi name element in the xml should just be [name] and jboss should handle the rest.
          .

          This worked for me after playing around with the setting in jboss. I just got this working recently so cant say more than this for now.

          k