1 Reply Latest reply on Sep 24, 2004 4:28 AM by darranl

    CMP / JDBC-conn-lookup

      Hi,

      I have a full-developed project witch use CMP-beans. The DataSource name is present
      only in jbosscmp-jdbc.xml file.

      Now, I need to read some config-params from a "config" DB-table via direct JDBC-connection
      from JDBC-pool.

      Can I do this without re-declare DSname in:
      oContext.lookup(DSname) call but with the
      default-one already present in jbosscmp-jdbc.xml file?

      Platform: JBOSS 4.0

      TIA
      Roberto Colmegna

        • 1. Re: CMP / JDBC-conn-lookup
          darranl

          In this situation you would want to add a <resource-ref> entry for your datasource in your ejb-jar.xml and jboss.xml deployment descriptors.

          This will result in the datasource being bound to the java:comp/env namespace of the component using it. If in future you want to change which datasource you are using you just change which one is references.

          The contents for the required elements are described in the dtds.