2 Replies Latest reply on Mar 11, 2009 6:22 PM by Lisa Cao

    pulling connection url out of Datasource files

    Lisa Cao Newbie


      Currently jboss 4.2.2 is set up to connect to the oracle db using xx-ds.xml files with the following format:

       < password>yyyy</ password>
       <!-- Uses the pingDatabase method to check a connection is still valid before handing it out from the pool -->
       <!-- Checks the Oracle error codes and messages for fatal errors --> <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
       <!-- sql to call when connection is created-->
       <new-connection-sql>SELECT 1 FROM DUAL</new-connection-sql>
       <!-- sql to call on an existing pooled connection when it is obtained from pool -->
       <check-valid-connection-sql>SELECT 1 FROM DUAL</check-valid-connection-sql>

      There is one file defined for each datasource, and we have ~10 such files. Now we are migrating over to Oracle RAC, so the connection url requires changing. However, if we add more hosts to later on, I do not want to have to change the connection URL for each datasource file again. Is it possible to pull out the connection URL and place it somewhere so it gets defined only once, and refer to that in all the xx-ds.xml files?

      I am thinking no, but :) just want to see if I am missing any jboss set up options here...

      Thanks very much!