1 Reply Latest reply on Jun 9, 2003 10:59 AM by Chris Harris

    Need a straight answer on Oracle DefaultDS

    Jim Underwood Newbie

      Can anyone provide a straight answer as to what needs to be configured how so as to use Oracle as the

      java:env/comp/jdbc/DefaultDS

      for an EJB on Jboss 3.2.1? I don't need CMP or anything else.

        • 1. Re: Need a straight answer on Oracle DefaultDS
          Chris Harris Newbie

          Well, firstly, you are trying to access a part of the JNDI space called the ENC (Environment Naming Context) which is specific to the particualr component you are calling from. You create entries in this bit of JNDI (the comp/env bit) by adding resource references to the deployment descriptor for your component (probably an EJB or a servlet) - the standard J2EE documentation will tell you how to do this.

          But I suspect your problem is more related to using Oracle as the 'global' DefaultDS? The first thing you need to think about is whether you should do this at all - many components rely on DefaultDS, such as some JMS persistence managers - and you need to do some configuration to get them to work properly with another database since the default setup is usually for Hypersonic. If you don't want to do all this, then you can set up a completely different datasource and make aliases to it through resource refs as mentioned above to get access to *an* oracle datasource.

          There are example configurations in the distribution which show you how to set up an Oracle datasource. You'll need to create, probably in the 'deploy' directory of your server, a file called something like oracle-xa-ds.xml. Easiest way is to copy it from the docs/examples/jca directory of your jboss distribution. Then fiddle with the parameters inside that XML to get your connection set up.

          The jndi-name element gets prefixed by java:/ in the JNDI tree - so if your XML file has <jndi-name>OracleDS</jndi-name> then your datasource object will deploy to java:/OracleDS in JNDI and can be looked up directly.

          You should be able to work out the 3 xa-datasource-property elements yourself - I would recommend against using the OCI driver and go for the thin variant - see the Oracle JDBC driver docs for details.