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!

      Euan.

        • 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 -->
          <!-- ==================================================================== -->

          300

          <!-- Use this attribute if you need to use a specific Xid
          implementation -->
          oracle.jdbc.xa.OracleXid



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


          org.hsql.jdbcDriver,org.enhydra.instantdb.jdbc.idbDriver,oracle.jdbc.driver.OracleDriver



          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:
          jdbc:oracle:thin:@192.168.1.111:1521:testdb


          DefaultDS
          org.jboss.pool.jdbc.xa.wrapper.XADataSourceImpl
          jdbc:oracle:thin:@::
          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

          java:/OracleDB
          <type-mapping>Oracle8</type-mapping>
          false