mercoledì 4 febbraio 2015

The tutorial explains how to install a jdbc driver on RedHat WildFly application server a module, in the sample will be used the mysql driver but the proposed steps can be applied to any other driver library

Used technologies in the tutorial:

  • Wild Fly 8.2.0.Final
  • Mysql Connector 5.1.33

1. Create the jboss module

Enter in the file path ${EAP_HOME}/modules/system/layers/base and create the directories com/mysql/driver/main.

Into the folder main copy the driver library jar (link) and create a file module.xml as showed in the sample below

<module xmlns="urn:jboss:module:1.3" name="com.mysql.driver">
 <resources>
  <resource-root path="mysql-connector-java-5.1.33.jar" />
 </resources>
 <dependencies>
  <module name="javax.api"/>
  <module name="javax.transaction.api"/>
 </dependencies>
</module>

For an explanation about the meaning of the fields take a look at Jboss Module Documentation Page

2. Register the module as driver with CLI.

Start the server from the directory ${EAP_HOME}/bin:

./standalone.sh --server-config=${server-profile}

Start the management CLI:

./jboss-cli.sh

Run the the command:

/subsystem=datasources/jdbc-driver=mysql:add(driver-name=mysql,driver-module-name=com.mysql.driver,driver-class-name=com.mysql.jdbc.Driver)

If the operation is successful then the message below will be showed {"outcome" => "success"}

and into the file of the standalone profile the code below is produced

...
<driver name="mysql" module="com.mysql.driver">
    <driver-class>com.mysql.jdbc.Driver</driver-class>
</driver>
...
Categories: ,

9 commenti:

  1. Risposte
    1. Thanks for your great posting! I certainly enjoyed reading it, you would be a great author. study in canada consultant in jalandhar

      Elimina
  2. Very good, excellent. I am brasilian.

    RispondiElimina
  3. Very good, excellent. I am swedish.

    RispondiElimina
  4. Very good, excellent. I am greek.

    RispondiElimina
  5. Thank You!! Helps a lot! Java EE Casa do Codigo =(!!!

    RispondiElimina
  6. I just see the post i am so happy the post of information's.So I have really enjoyed and reading your blogs for these posts.Any way I’ll be subscribing to your feed and I hope you post again soon.

    seo company in chennai

    RispondiElimina
  7. It’s amazing in support of me to have a site, which is useful in support of my know-how. thanks admin, you surely come with remarkable articles. Cheers for sharing your website page.Excellent blog here...
    Study in Canada Education Consultants in Chennai

    RispondiElimina

Subscribe to RSS Feed Follow me on Twitter!