Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QDB2 driver not loaded
Forum Updated to NodeBB v4.3 + New Features

QDB2 driver not loaded

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 4.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Sibyx
    wrote on last edited by
    #1

    Hi,
    I compiled driver for IBM DB2 with msvc 2010, binaries (qsqldb24.dll and qsqldb2d4.dll) I copied to C:\Development\QtSDK\Desktop\Qt\4.8.1\msvc2010\plugins\sqldrivers . Now I have application where I'm using QDB2 driver:
    @IBMConn::IBMConn(QString host, QString port, QString user, QString password, QString database)
    {
    conn = QSqlDatabase::addDatabase("QDB2");
    conn.setHostName(host);
    conn.setDatabaseName(database);
    conn.setUserName(user);
    conn.setPassword(password);
    if (!port.isNull()) {
    conn.setPort(port.toInt());
    }
    if (!conn.open()) {
    appLogger->Log(Logger::LOG_DRIVER,QString("Error: %1").arg(conn.lastError().text()));
    }
    else {
    appLogger->Log(Logger::LOG_DRIVER, "IBM DB2 driver inicialized");
    appLogger->Log(Logger::LOG_DRIVER, "Connected to " + host);
    }
    }@
    In this project I use msvc 2010 compiler (same as before) and when I run my app, output is:
    @QSqlDatabase: QDB2 driver not loaded
    QSqlDatabase: available drivers: QIBASE QSQLITE QMYSQL3 QMYSQL QOCI8 QOCI QODBC3 QODBC@
    I don't understand why my plugin isn't loaded.

    1 Reply Last reply
    0
    • H Offline
      H Offline
      Hostel
      wrote on last edited by
      #2

      I don't use DB2 but for example plugin for PostgreSQL requires a dll for connecting to db. Maybe your plugin can't load dll for db2. Use a Dependency Walker to check for missing dll for QDB2 plugin.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        Sibyx
        wrote on last edited by
        #3

        I use Depency Walker and I found these depencies:

        • db2app.dll
        • db2cli.dll
        • db2dascmn.dll
        • db2g11n.dll
        • db2genreg.dll
        • db2install.dll
        • db2licm.dll
        • db2locale.dll
        • db2osse.dll
        • db2osse_db3.dll
        • db2sdbin.dll
        • db2sys.dll
        • db2trcapi.dll
        • db2wint.dll
        • gpsvc.dll
        • IEShims.dll
        • sysntfy.dll
          Now, my driver is loaded but I have next problem:
          @Starting C:\Users\magia\Qt\DatabaseExporter\debug\DatabaseExporter.exe...
          QDB2Driver::open: Unable to allocate environment Error:
          C:\Users\magia\Qt\DatabaseExporter\debug\DatabaseExporter.exe exited with code 0@
        1 Reply Last reply
        0
        • H Offline
          H Offline
          Hostel
          wrote on last edited by
          #4

          @
          QDB2Driver::open: Unable to allocate environment
          @
          This warning is in db2 plugin source. Are you sure that connect data is correct? Check a values of host, port, password etc. Can you connect to db from other tool on this values?

          Maybe there are another dependencies in dlls - check all of dlls for another dependencies by Dependency Walker:
          @
          db2app.dll
          db2cli.dll
          db2dascmn.dll
          db2g11n.dll
          db2genreg.dll
          db2install.dll
          db2licm.dll
          db2locale.dll
          db2osse.dll
          db2osse_db3.dll
          db2sdbin.dll
          db2sys.dll
          db2trcapi.dll
          db2wint.dll
          gpsvc.dll
          IEShims.dll
          sysntfy.dll
          @

          1 Reply Last reply
          0
          • S Offline
            S Offline
            Sibyx
            wrote on last edited by
            #5

            I check all dependecies and I check my connect data too. All is fine, I try to connect do DB localy etc. but without any success. I try other machines with installed DB2 or not, I disabled firewall too. I don't know where is mistake

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved