XA for oracle may require a couple of other steps. Do you really need XA? Try the normal oracle driver first. You'll find it much easier to get going.
Thanks Norman. I can use Oracle9i with JBoss using oracle-ds.xml. It's very simple. I wrote it down here so that newbies like me can take a look.
- change oracle-ds.xml and copy the changed version to deploy directory
- set Pad in jboss-service.xml to true
- copy Oracle driver to lib directory
- you should use jbosscmp-jdbc.xml in your ejb jar file so that you can leave the standardjbosscmp-jdbc.xml intact.
This is my jbosscmp-jdbc.xml file
<!DOCTYPE jbosscmp-jdbc PUBLIC "-//JBoss//DTD JBOSSCMP-JDBC 4.0//EN" "http://www.jboss.org/j2ee/dtd/jbosscmp-jdbc_4_0.dtd"> <jbosscmp-jdbc> <defaults> <datasource>java:/OracleDS</datasource> <create-table>true</create-table> <alter-table>false</alter-table> <remove-table>false</remove-table> </defaults> <enterprise-beans> <entity>
<create-table> should be true if you don't have that table already created in your database.
Norman, I'll need your advice when I go to oracle-xa-ds.xml. Is that ok?
Don't use jbosscmp-jdbc.xml. It'll make your ejb unportable.
Make a little change in standardjbosscmp-jdbc.xml and everything will be fine.
That is incorrect. There is no impact on portability. The changes are identical in their impact on portability, but keeping them in jbosscmp-jdbc.xml lets you keep the configuration local to one application. It also means that you won't have re-apply the global changes when you update to a newer version of JBoss.
What I meant by portability is if we use jbosscmp-jdbc.xml, we cannot bring the whole directory contaning java and xml files to other application servers because they will not understand what jbosscmp-jdbc.xml is. Am I right?
You are correct that other application servers would not understand the file, but this wouldn't really cause any sort of problem. You'd need to add the appropriate deployment descriptors for the other application server, but the presence of the JBoss ones shouldn't impact the other server in any way.