Forum Discussion

Purush's avatar
Purush
Occasional Contributor
3 years ago

Unable to connect DB2 using the JDBC driver

Hello,

Recently, i have downloaded the new version of READY API (3.20.2) and started using it.

Unfortunately, I am not able to connect to the database (DB2).

I downloaded the jar (db2jcc4-9.7.jar) and saved it in the bin folder (...ReadyAPI-3.10.0\bin\ext).

My java version is 1.8.0_301.

I tried setting the classpath as suggested.

 

Still it is returning an error message:

"com.eviware.soapui.support.SoapUIException: Failed to initialize the connection that uses the [com.ibm.db2.jcc.DB2Driver] driver. Connection string: [jdbc:db2://xxxxxxx-db2-xx:xxxxx/xxxxx:user=xxxxxx;password=####;]."

 

Thanks in advance for your suggestions.

 

Regards

Purush

 

  • Hey Purush,

    Firstly you need to confirm the following:

    1. What version of DB2 are you trying to connect to? (ASK YOUR DBAs)
    2. What is correct version of jdbc drivers to connect to your DB2 version? and download correct version and save to %/bin/ext (GOOGLE SEARCH)
    3. What is the version of java that supports your jdbc drivers? and download correct java version and set your java environment variable if needed (GOOGLE SEARCH)
    4. You have a DB2 JDBC connection string defined in File >> Preferences >> JDBC. You need to determine the correct parameter values defined to connect to your DB2 instance (ASK DBAs)

    Then setup a JDBC test step, pointing to the DB2 driver and then complete the dynamically generated fields with the parameter values your DBAs have indicated.

    I appreciate you may have done all the above already, however, there's only 3 things (java (maybe environment variable), drivers, connection string) required to setup a connection correctly and if youre having problems the issue is with at least one of these. The fact that the error is saying failed to initialise connection makes me think drivers or connection string, but ive found when struggling its best (at least for me) to start the whole process again, so i know ive got everything set correctly.

    Once you've confirmed all the above, reply to this so we can see where you are and if youre still struggling we can go from there.

    Cheers,

    Rich
  • richie's avatar
    richie
    Community Hero
    Hey Purush,

    Firstly you need to confirm the following:

    1. What version of DB2 are you trying to connect to? (ASK YOUR DBAs)
    2. What is correct version of jdbc drivers to connect to your DB2 version? and download correct version and save to %/bin/ext (GOOGLE SEARCH)
    3. What is the version of java that supports your jdbc drivers? and download correct java version and set your java environment variable if needed (GOOGLE SEARCH)
    4. You have a DB2 JDBC connection string defined in File >> Preferences >> JDBC. You need to determine the correct parameter values defined to connect to your DB2 instance (ASK DBAs)

    Then setup a JDBC test step, pointing to the DB2 driver and then complete the dynamically generated fields with the parameter values your DBAs have indicated.

    I appreciate you may have done all the above already, however, there's only 3 things (java (maybe environment variable), drivers, connection string) required to setup a connection correctly and if youre having problems the issue is with at least one of these. The fact that the error is saying failed to initialise connection makes me think drivers or connection string, but ive found when struggling its best (at least for me) to start the whole process again, so i know ive got everything set correctly.

    Once you've confirmed all the above, reply to this so we can see where you are and if youre still struggling we can go from there.

    Cheers,

    Rich
    • Purush's avatar
      Purush
      Occasional Contributor

      Hi Richie,

      Thanks a lot for taking time to reply my message.

      As suggested, i will contact my DBA for more details.

      I try again as mentioned in your mail and get back to you.

      Kind regards

      Purush

       

       

    • Purush's avatar
      Purush
      Occasional Contributor

      Hi Richie,

      Thanks for your suggestions and it worked well.

      The version driver was not good.

      Regards

      Purush