Installing Oracle JDBC-Driver On Wildfly / JBoss 📎
- Download the driver: ojdbc[VERSION].jar
- Create subfolders
[WILDFLY_HOME]/modules/system/layers/base/com/oracle/main/ - Copy the downloaded
ojdbc[VERSION].jarinto the freshly created folder - 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> - In the configuration file
standalone.xmladd the entry:
within the<driver name="oracle" module="com.oracle"> <driver-class>oracle.jdbc.driver.OracleDriver</driver-class> </driver><drivers>tag. -
Add a datasource definition within the
<datasources>tag (next toExampleDS):<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>
Now enjoy the simplicity of Java EE :-)
See you at Java EE Workshops at Munich Airport, Terminal 2 or Virtual Dedicated Workshops / consulting