Forum Discussion

Adagio's avatar
Adagio
Frequent Contributor
7 years ago
Solved

JDBC request with external driver DB2/AS400

Hello,

 

I have to connect Testcomplete project with Db2/AS400 database using JDBC request. It requires a driver so I copied the jt400 jar in the 'bin' folder of TestComplete. I'm using the following to establish the connection between the TestComplete project and DB2/AS400:

 

 

var  conn  = ADO.CreateADOConnection();

conn.ConnectionString =
"Driver =jt400.jar;"+
"Data Source =ussys;" +
"CurrentSchema=USER;" +
"User ID=XXXXXXX;" + 
"Password=XXXXXXX;"

conn.LoginPrompt = false;
conn.Open();

 

I see a runtime error: OLE 80040E4D

 

I think it's related to the Connection string, but I'm not able to find out what's wrong. 

Could someone please help me understand what's missing in the connection string or anything else?

 

Thank you

Abhi

 

 

 

 

 

 

  • Hi Abhi,

     

    JDBC and .jar files is Java-related stuff. You need to find regular Windows 32-bit ODBC drivers (or OLE providers) (because TestComplete is 32-bit application) for DB2/AS400 and install them. Whether or not will these drivers require Java depends on their implementation and I hope that their respective installers will take care about this.

    Than you will have to create DSN, referencing the database that you are going to use, using ODBC Administrator and use this DSN when specifying connection for .CreateADOConnection(). This is in case ODBC drivers are used. In case of OLE providers, no DSN is required and connection string must be provided for .CreateADOConnection().

     

    P.S. This thread (https://community.smartbear.com/t5/TestComplete-Functional-Web/Can-anyone-help-me-how-to-access-Mongo-database/td-p/86442) may help you with creation of connection string.

  • Adagio's avatar
    Adagio
    7 years ago

    Thank you, Alex! This helped me.

     

    Windows 64-bit machines come with 32-bit and 64-bit odbc drivers so I didn't have to install a new one.

    But for AS400 I'm using IBMDA400 driver which made the connection work. 

     

    appreciate your help!

     

    Thank you

    Abhishek

7 Replies

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi Abhi,

     

    JDBC and .jar files is Java-related stuff. You need to find regular Windows 32-bit ODBC drivers (or OLE providers) (because TestComplete is 32-bit application) for DB2/AS400 and install them. Whether or not will these drivers require Java depends on their implementation and I hope that their respective installers will take care about this.

    Than you will have to create DSN, referencing the database that you are going to use, using ODBC Administrator and use this DSN when specifying connection for .CreateADOConnection(). This is in case ODBC drivers are used. In case of OLE providers, no DSN is required and connection string must be provided for .CreateADOConnection().

     

    P.S. This thread (https://community.smartbear.com/t5/TestComplete-Functional-Web/Can-anyone-help-me-how-to-access-Mongo-database/td-p/86442) may help you with creation of connection string.

    • Adagio's avatar
      Adagio
      Frequent Contributor

      Thank you, Alex! This helped me.

       

      Windows 64-bit machines come with 32-bit and 64-bit odbc drivers so I didn't have to install a new one.

      But for AS400 I'm using IBMDA400 driver which made the connection work. 

       

      appreciate your help!

       

      Thank you

      Abhishek

      • nandini9's avatar
        nandini9
        Occasional Contributor

        Hi Abhishek,

        I didn't find IBMDA400 driver in my system with windows 64bit. Did you install it seperately or did you get it through OS directly?

        If installed, what is the exact driver name you installed?

        Kindly let me know 

         

        Thanku you,

        Nandini