Jboss 5.0 datasource config in ear file. How can I run oracle 10g and 11g on the same server?

Currently my setup is:

in my ear META-INF / jboss-app.xml

<jboss-app>
  <module>
    <service>datasource-ds.xml</service>
  </module>
</jboss-app>

      

and datasource-ds.xml

<datasources>
  <local-tx-datasource>
    <jndi-name>jdbc/mydeployment</jndi-name>
    <connection-url>jdbc:oracle:thin:@eir:myport:mydbname</connection-url>
        <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
    <user-name>myuser</user-name>
    <password>mypassword</password>
    <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
       <metadata>
         <type-mapping>Oracle9i</type-mapping>
      </metadata>
  </local-tx-datasource>
</datasources>

      

and it works when ojdbc5.jar is in my server name / lib.

How can I customize the oracle driver information in my .ear file so that I have two different ear deployment options, one using Oracle 10g and one using oracle 11g?

EDIT: I have phrased the question incorrectly. I meant how can I expand the ear using ojbc * .jar in the ear file and not in the server / lib directory. There are different applications deployed in my installation and I want them to be completely self-contained. One of the apps uses 11g and the others use 10g. Currently the ones using 10g are ear files and the one using 11g is a military file, so it works. Now I'm going to convert the ear files to war files (I don't need the ear features) to check how much Permgen space is being used. So I guess my question is: I meant, how can I expand the ear using ojbc * .jar in the ear file and not in the server / lib directory?

+2


a source to share


2 answers


In the ojdbc.jar version, if you do not need specific features of the desired driver that do not exist in the latest version, then always use only the latter, as they will always be compatible with each other. In this case, it is better to use the central repo of the server server ... but as they say, I fully understand the requirement to make each web application independent and more easily deployable.

When deploying, if you are using an IDE, you can define the jdbc jar as "library" and then in "deploy" you can install it to deploy the libraries with code. In JDeveloper, when you define a custom library, you can select Deploy it by default, which will automatically assign it to be grouped into a WAR or EAR assembly that comes from projects that use that library. Unless you set the custom library as "deploy by default" or your IDE does not have this setting, typically the "deploy" options (or some part of your IDE manages the WAR and EAR assemblies) will have a section to choose which libraries to include.



If you are not using an IDE, you can manually push these jar files into WEB-INF/lib

in your warfile structure.

0


a source


Just duplicate you datasource.xml

 ig datasource-ds10g.xml

and datasource-ds11g.xml

with the correct ones connection-url

. And link from your source. Data sources.



0


a source







All Articles