-
1. Re: Oracle / JNDI / EJB / Tomcat
neillamoureux Nov 26, 2001 11:59 AM (in response to euanjonker)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