1 Reply Latest reply on Nov 26, 2001 11:59 AM by Neil Lamoureux

    Oracle / JNDI / EJB / Tomcat

    Euan Newbie

      Hey there.
      I've been struggling now for quite a while, and I must say, JBoss is rather tricky!
      Can ANYONE, PLEASE, send me their complete setup files where Oracle has been setup so it can be accessed by an EJB via JNDI.

      Oh, and I'm using it along with Tomcat.

      I really need help with this, and YOUR help would be greatly appreciated!


        • 1. Re: Oracle / JNDI / EJB / Tomcat
          Neil Lamoureux Newbie

          Well, I won't give you all of my config files, but here are some step by step instructions (for Oracle 8.1.7 and JBoss 2.4.0). Using these instructions, you can use CMP beans or connect to Oracle via:

          InitialContext context = new InitialContext();
          DataSource ds = (DataSource) context.lookup("java:/OracleDB");

          1. Copy oracle’s classes12.zip (this is available from Oracle technet,and has the jdbc driver) to $JBOSS_DIST/lib/ext.

          2. Note that jboss.properties does NOT need to be modified (as indicated in the jboss.properties file).

          3. Modify $JBOSS_DIST/conf/tomcat/jboss.jcml: Uncomment the XidClassName attribute shown below:

          <!-- ==================================================================== -->
          <!-- Transactions -->
          <!-- ==================================================================== -->


          <!-- Use this attribute if you need to use a specific Xid
          implementation -->

          4. Also in jboss.jcml: add the Oracle driver to the JDBC drivers (this driver is in classes12.zip):
          <!-- ==================================================================== -->
          <!-- JDBC -->
          <!-- ==================================================================== -->


          5. Also in jboss.jcml, define what the oracle datasource name is (say OracleDB), and the connection URL. In the code below, replace jdbc:oracle:thin:@:: with the appropriate string for your installation. Such as:

          your user name here
          the password which I am not going to put here but has to be in the actual jboss.jcml

          6. Modify $JBOSS_DIST/conf/tomcat/standardjaws.xml to use the OracleDB datasource via the element, and to use Oracle8 jdbc-sql type mappings