Forum Discussion

Said's avatar
Said
Contributor
7 years ago

Failed to initialize the connection that uses the [COM.ibm.db2.jdbc.app.DB2Driver] driver

Hi,

I am getting error "Failed to initialize the connection that uses the [COM.ibm.db2.jdbc.app.DB2Driver] driver" in JDBC teststep.

Connection string: [jdbc:db2://<MyDB2ServerName>:<Portnumber>/<DatabaseName>?user=<UserName>&password=#####;].

The database is a DB2 database (on AS400 i think). I have installed the db2jcc.jar file in folder: ReadyAPI-2.5.0\bin\ext

Can someone help with this issue?

 

Thanks in advance.

 

  • Said's avatar
    Said
    7 years ago

    richie and Olga_T and All,

     

    Just today I got a solution with support of our IT-Support department. :smileyhappy:

    The solution is to use jt400.jar. This file is provided to me by the IT-Support department. Copy the file to in bin/ext folder. Enter the following in SoapUI Pro JDBC test step:

    Driver: com.ibm.as400.access.AS400JDBCDriver

    Connection String: jdbc:as400://<host_name>/<default-schema>;<properties> 

    All works great!

  • richie's avatar
    richie
    Community Hero

    Hi,

    A while back I struggled to connect to a MIMER RDBMS - i know this isn't DB2, but the instructions should be transferable I would've thought. The instructions I wrote for myself to get it working are below (I've altered them slightly for your scenario)
    1. Install appropriate JDK version (have you checked the version of the driver .jar file you are using is correct relative to the version of Java installed? - this was one of the problems I had - the JDK version was incorrect relative to the driver file's published java version)

    2. Ensure PATH environment variable doesn't point to another version of Java (at command prompt run 'echo %PATH%' to check this)

    3. Set JAVA_HOME to appropriate JDK's bin directory (e.g. C:\jdkv1.8\bin) - e.g. at command prompt run 'set JAVA_HOME=%JAVA_HOME%;C:\jdkv1.8\bin'

    4. At command prompt run 'java -version' to ensure it's picking up appropriate JDK rather than other versions of Java

    5. Download the jdbc driver file (db2whatevs.jar) and copy this to 'C:\Program Files\SmartBear\ReadyAPI-2.x.x\bin\ext'

    6. Create or update the CLASSPATH environment variable, pointing to the location of the .jar file. Run the following command via command prompt 'set CLASSPATH=%CLASSPATH%;C:\Program Files\SmartBear\ReadyAPI-2.x.x\bin\ext'

    7. There appear to be 2 different DB2 connection strings defined in the JDBC preferences in ReadyAPI! v2.4.0 - have you tried both?

    8. Final thought - double check that the connection string you're using matches the pattern in the JDBC config?


    when I was setting up my connection I was getting a 'failed to initialize connection' response because my jdbc connection string was incorrect - perhaps this is why you are getting the same response also?

    hope this helps!

    cheers,
    richie

    • Olga_T's avatar
      Olga_T
      SmartBear Alumni (Retired)

      Hi all,

       

      Great set of instructions, richie! Thank you for always going above and beyond!

      Said, have you had a chance to try the above solution?
      If it solves the issue, could you please mark those instructions as a Solution so that other users could find it easier in the future?
      Thank you in advance,

       

       

      • Said's avatar
        Said
        Contributor

        richie and Olga_T and All,

         

        Just today I got a solution with support of our IT-Support department. :smileyhappy:

        The solution is to use jt400.jar. This file is provided to me by the IT-Support department. Copy the file to in bin/ext folder. Enter the following in SoapUI Pro JDBC test step:

        Driver: com.ibm.as400.access.AS400JDBCDriver

        Connection String: jdbc:as400://<host_name>/<default-schema>;<properties> 

        All works great!