3 Replies Latest reply on May 2, 2007 3:16 PM by sam code

    Urgent: JNDI name syntax

    John Baker Newbie


      In my J2EE application, I'm unable to create a datasource.

      The JNDI name I provide is APP_ApacheDerby
      but creating this fails.

      Could this be syntax problem in that the "_" underscore character
      is invalid ?

      Thanks,
      John

        • 1. Re: Urgent: JNDI name syntax
          srinivasu kondreddy Newbie

          Hai

          If u are using Mysql,copy mysql-ds.xml (location is [jboss-location]/ docs/examples/jca/..) xml file into [jboss-location]/server/default/deploy/
          and change ip,port,url,driver..


          <local-tx-datasource>
          <jndi-name>MySqlDS</jndi-name>
          <connection-url>jdbc:mysql://127.0.0.1:3306/test</connection-url>
          <driver-class>com.mysql.jdbc.Driver</driver-class>
          <user-name>root</user-name>

          <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name>
          <!-- sql to call when connection is created
          <new-connection-sql>some arbitrary sql</new-connection-sql>
          -->
          <!-- sql to call on an existing pooled connection when it is obtained from pool
          <check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql>
          -->

          <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->

          <type-mapping>mySQL</type-mapping>

          </local-tx-datasource>



          Use this MySqlDS as jndi name(ex:java:/MySqlDS

          • 2. Re: Urgent: JNDI name syntax
            sam code Newbie

            Hi,

            Well, If you are using MySQL then follow the above steps, but i see you have specified the Derby database. If you are using the Derby database then you need to copy derby-ds.xml, (location is [jboss-location]/ docs/examples/jca/derby-ds.xml) into [jboss-location]/server/default/deploy/

            If i am not wrong you will get derby-ds.xml in JBoss4.x versions.

            Also, your <jndi-name> in [derby-ds.xml] would be as "DerbyDS" and in it will be "java:/DerbyDS".

            Hope this helps!

            Regards,
            -sam

            • 3. Re: Urgent: JNDI name syntax
              sam code Newbie

              Missed to mention datasource.

              Also, your <jndi-name> in [derby-ds.xml] would be as "DerbyDS" and in "datasource" it will be "java:/DerbyDS".

              Regards,
              -sam