INSTALLING ORACLE JDBC-DRIVER ON WILDFLY / JBOSS

  1. Download the driver: ojdbc[VERSION].jar
  2. Create subfolders [WILDFLY_HOME]/modules/system/layers/base/com/oracle/main/
  3. Copy the downloaded ojdbc[VERSION].jar into the freshly created folder
  4. Create a file module.xml, in the same folder as above, with the contents:
    
    <module xmlns="urn:jboss:module:1.1" name="com.oracle">
      <resources>
        <resource-root path="ojdbc[VERSION].jar"/>
      </resources>
      <dependencies>
        <module name="javax.api"/>
        <module name="javax.transaction.api"/>
      </dependencies>
    </module>
    
    
  5. In the configuration file standalone.xml add the entry:
    
    <driver name="oracle" module="com.oracle">
     <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
    </driver>
    
    

    within the <drivers> tag.

  6. Add a datasource definition within the <datasources> tag (next to ExampleDS):
    
    <datasource jndi-name="java:/[NAME]" pool-name="OracleDS" enabled="true">
     <connection-url>jdbc:oracle:thin:@[HOST_NAME]:1521:[SID]</connection-url>
      <driver>oracle[has to match the driver name]</driver>
      <pool>
       <min-pool-size>1</min-pool-size>
       <max-pool-size>5</max-pool-size>
       <prefill>true</prefill>
      </pool>
      <security>
       <user-name>[USER]</user-name>
       <password>[PWD]</password>
      </security>
    </datasource>
    

Adam -bien
<

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s