4 Replies Latest reply on Jan 6, 2018 3:09 PM by emeuwese

    RHEL7 Wildfly 11 and DB2

    davidjkenner

      I am trying to create a DB2 data source on Wildfly 11.  From the console I have deployed:

       

      db2jcc.jar

      db2jcc_license_cisuz.jar

       

      Then when I go to

       

      datasources > non-xa > Add > IBM DB2 datasource >

      DB2DS

      java/DB2DS

       

      Next > Detected Driver

      No DB2 driver is seen.

       

      I have also tried rebooting Wildfly to make sure it sees the deployments

       

      Any help is greatly appreciated.

        • 1. Re: RHEL7 Wildfly 11 and DB2
          anijhawa

          You can see in the Step 2/3: JDBC Driver  3 below parameters in the console while creating datasource

          Name: Give it to any name.

          Module Name: place the jar in wildfly module folder and give that path to in this filed.

          Driver Class: give it driver class as it is already there related to DB2 data source.

           

          It will not detect direly you need to create a module and give that module name path to the module name field.

           

          Please follow the link to create the jboss module and how to place DB2 jar in it .

           

          http://giordanomaestro.blogspot.in/2015/02/install-jdbc-driver-on-wildfly.html

           

          Please let me know if you have any further issue.

          • 2. Re: RHEL7 Wildfly 11 and DB2
            davidjkenner

            Thanks for the quick reply.  So the only way to add a DB2 driver is through updating the xml files and not through the Admin Console?  Again in the Admin Console it does not show the DB2 driver under "Detected Drivers".  I was able to create a MySQL datasource through the Admin Console and I was hoping to be able to do it with DB2.

            • 3. Re: RHEL7 Wildfly 11 and DB2
              zhurlik

              Hi,

               

              Could you provide your files: db2jcc.jar, db2jcc_license_cisuz.jar and if it's possible wildfly-11.0.0.Final/standalone/log/server.log?

              Have you looked at DataSource configuration - Latest WildFly Documentation - Project Documentation Editor?

              Which approach would you like to use via a regular jar deployment or modules?

               

              Thanks,

              Vlad

              • 4. Re: RHEL7 Wildfly 11 and DB2
                emeuwese

                Did you create a file structure like this?

                \modules\system\layers\base\com\ibm\db2\main

                \modules\system\layers\base\com\ibm\db2\main\module.xml

                <?xml version="1.0" encoding="UTF-8"?>
                <module xmlns="urn:jboss:module:1.3" name="com.ibm.db2">
                    <resources>
                        <resource-root path="db2jcc4.jar"/>
                    </resources>
                    <dependencies>
                      <module name="javax.api"/>
                      <module name="javax.transaction.api"/>
                      <module name="javax.servlet.api" optional="true"/>
                    </dependencies>
                </module>
                

                \modules\system\layers\base\com\ibm\db2\main\db2jcc4.jar

                 

                db2jcc.jar JDBC 3.0 driver is deprecated. db2jcc4.jar is the JDBC 4.x driver IBM DB2 JDBC Driver Versions and Downloads - United States

                 

                <subsystem xmlns="urn:jboss:domain:datasources:5.0">
                    <datasources>
                  ...
                  <drivers>
                   ...
                   <driver name="ibmdb2" module="com.ibm.db2">
                    <driver-class>com.ibm.db2.jcc.DB2Driver</driver-class>
                   </driver>
                  </drivers>
                 </datasources>
                </subsystem>
                
                
                

                Both db2jcc.jar and db2jcc4.jar show up in the list of detected drivers in Wildfly 11 when I go to the web console Configuration > Profiles > <myprofile> > Datasources > Non-XA > Add