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. How to create the plugin of OCI for Qt
Forum Updated to NodeBB v4.3 + New Features

How to create the plugin of OCI for Qt

Scheduled Pinned Locked Moved General and Desktop
24 Posts 2 Posters 10.6k 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.
  • K Offline
    K Offline
    kirajustice
    wrote on last edited by
    #21

    Answer Thank you.
    But it also does not work.
    So I tried the other way attempt.
    I copy mingw32 / bin the dll file in the oracle_home / client / bin.
    I copy mingw32 / include the all file in the oracle_home / client / oci / include.
    I copy mingw32 / lib lib file in the oracle_home / client / oci / lib / msvc.
    qt 5.3 for desktop (mingw4.8 32bit) .exe
    -> cd c: \ qt \ 5.3 \ src \ qtbase \ src \ plugins \ sqldrivers \ oci
    -> qmake oci.pro
    -> mingw32-make
    In this way I
    lbisqloci.a
    qsqloci.dll
    qsqlocid.dll
    I created three files.
    Success!
    But can not open the db.

    QOCIDriver: unable to create environment
    OCIHandleAlloc segmentation fault

    The source is as follows:
    @ QSqlDatabase db;
    db = QSqlDatabase::addDatabase("QOCI8");
    db.setHostName("hostip");
    db.setDatabaseName("dbname");
    db.setUserName("userid");
    db.setPassword("userpw");
    db.setPort(1521);
    db.open();
    @
    Error is it because I had the wrong source code?
    Or so the plug incorrectly created?

    I would like to thank again
    the project be conducted .

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #22

      No, probably the wrong dll loading

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • K Offline
        K Offline
        kirajustice
        wrote on last edited by
        #23

        Your answer is right.
        Plug was incorrectly made​​.
        I have succeeded in making the plug-in using the plug-in method of making oci provided by qt.

        But Oracle Tns error occurs.

        ORA-12154: the specified connection identifier cannot be analyzed
        Unable to logon

        This is a reference when creating a plugin
        This is specified when creating a plug-in to see qsql_oci.cpp

        @
        connectionString =
        QString::fromLatin1("(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=%1)(Port=%2))"
        "(CONNECT_DATA=(SERVICE_NAME=%3)))").arg(hostname).arg((port > -1 ? port : 1521)).arg(db)@

        Configure the TNS that the source of that I think.

        The TNS using sqlplus and I have successfully completed the database connection
        Is that different, and this part of the TNS version of DB?

        1 Reply Last reply
        0
        • K Offline
          K Offline
          kirajustice
          wrote on last edited by
          #24

          I've solved.
          This is because you are helping.

          @connectionString =
          QString::fromLatin1("(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=%1)(PORT=%2)))"
          "(CONNECT_DATA=(SERVICE_NAME=%3)))").arg(hostname).arg((port > -1 ? port : 1521)).arg(db);@

          This was resolved by modifying the.
          Thanks .T_T

          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