Discussions

EJB programming & troubleshooting: JBoss Datasource Configuration and JNDI

  1. JBoss Datasource Configuration and JNDI (7 messages)

    Hi guys,
    I am using JBoss 3.0 & tomcat 4.0.3 bundle.
    I would like to set up a datasource for Oracle and its JNDi part also.

    can anybody help me ..

    tanks in advance.

    sameer menon
  2. Sameer,

    Edit the jboss.jcml file for the following nodes:
    1. Register oracle driver. Do not forget to include classes111/classes12 jar in to the classpath.
    2. Add a new datasource node.

    You can get the specific XML to be used from the demo datasources already defined in the jboss.jcml

    Regards.
  3. Thanks for the prompt reply Viral. But the jboss.jcml file was existing till Jboss 2.4.4 & tomcat bundle.
    I could not find the Jboss.jcml file in this distribution.
    please correct me if i am wrong.

    do we have to use the jaws configuration file.

    Thanks,
    Sameer Menon
  4. Sorry I overlooked the JBoss version u specified.

    In JBoss 3, goto the server/default/deploy directoy. You'll find many XML files, having the same nodes as of jboss.jcml. The idea is, you put any XML with the JCML nodes here, they get interpreted and deployed by the server.

    Put your 2.x JCML nodes for the Oracle DS into a <server> node and save as, say oracle_ds.xml file into the 'deploy' directory and your work is done. :)

    please note that I've not done much with JBoss 3, and i'm not sure if any JCML properties have been updated. I hope you'll take care of that.

    Regards.
  5. Viral,
    there is a file i found in the $JBOSS_DIST/docs/examples/jca/, oracle-service.xml.

    is that useful in any way..
    anyway i have not yet tried the option you mentioned..
    will try that too..
    thankx a ton.

    regards,
    sameer

  6. You have to use jaws.xml file : As an example, I used jboss 3.0 with its own default database (Hypersonic), and I wrote jaws.xml like this :

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE jaws PUBLIC "-//JBoss//DTD JAWS 3.0//EN" "http://www.jboss.org/j2ee/dtd/jaws_3_0.dtd">

    <jaws>
       <datasource>java:/DefaultDS</datasource>
       <type-mapping>Hypersonic SQL</type-mapping>

       <enterprise-beans>

          <entity>
             <ejb-name>com.company.component</ejb-name>

             <cmp-field>
                <field-name>myField</field-name>
                <column-name>myColumn</column-name>
             </cmp-field>
             <cmp-field>
                <field-name>myField2</field-name>
                <column-name>myColumn2</column-name>
             </cmp-field>
              ....

             <table-name>TABLE_NAME</table-name>
             <row-locking></row-locking>
          </entity>

       </enterprise-beans>

    </jaws>
  7. :)
  8. Thanks for the prompt reply Viral. But the jboss.jcml file was existing till Jboss 2.4.4 & tomcat bundle.
    I could not find the Jboss.jcml file in this distribution.
    please correct me if i am wrong.

    do we have to use the jaws configuration file.

    Thanks,
    Sameer Menon