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. Oracle database connection failure
Forum Updated to NodeBB v4.3 + New Features

Oracle database connection failure

Scheduled Pinned Locked Moved Unsolved General and Desktop
12 Posts 4 Posters 4.5k 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.
  • A Offline
    A Offline
    Atiker
    wrote on 9 Dec 2017, 12:01 last edited by A Former User 12 Sept 2017, 15:19
    #1

    hello,
    I am quite new to Qt and I want to establish connection between Qt and Oracle. I researched various articles even the online Qt documentation. None of them helped and end up with failure to connect Oracle database. Is there anyone can explain step by step guide for dummies to connect with Oracle database? My environment is:
    OS=windows 10
    Qt=5.10
    Database=Oracle 12
    Thanks in advance.

    J 1 Reply Last reply 9 Dec 2017, 12:45
    0
    • A Atiker
      9 Dec 2017, 12:01

      hello,
      I am quite new to Qt and I want to establish connection between Qt and Oracle. I researched various articles even the online Qt documentation. None of them helped and end up with failure to connect Oracle database. Is there anyone can explain step by step guide for dummies to connect with Oracle database? My environment is:
      OS=windows 10
      Qt=5.10
      Database=Oracle 12
      Thanks in advance.

      J Offline
      J Offline
      JonB
      wrote on 9 Dec 2017, 12:45 last edited by JonB 12 Sept 2017, 12:51
      #2

      @Atiker
      While you're waiting for an expert (not me!), have you tried something like https://stackoverflow.com/questions/3646854/qt-oracle-connecting-problem (assuming that's appropriate to you), and what error do you get?

      From reading, I think you may have to do some Qt compilation to get QOCI driver. https://forum.qt.io/topic/53051/solved-connect-oracle-database-from-qt-creator and http://doc.qt.io/qt-5/sql-driver.html#qoci

      1 Reply Last reply
      0
      • A Offline
        A Offline
        Atiker
        wrote on 9 Dec 2017, 12:51 last edited by
        #3

        I don`t know how to set up the environment. Here is the error message in Qt:
        QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QODBC QODBC3 QPSQL QPSQL7
        "Driver not loaded Driver not loaded".

        J 1 Reply Last reply 9 Dec 2017, 12:53
        0
        • A Atiker
          9 Dec 2017, 12:51

          I don`t know how to set up the environment. Here is the error message in Qt:
          QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QODBC QODBC3 QPSQL QPSQL7
          "Driver not loaded Driver not loaded".

          J Offline
          J Offline
          JonB
          wrote on 9 Dec 2017, 12:53 last edited by JonB 12 Sept 2017, 12:56
          #4

          @Atiker
          You do not have the QOCI driver available, which is what you will need for Oracle. The above topics discuss this and what you have to do. My reading is that it does not come distributed with Qt (possible copyright reasons), and you have to build it yourself.
          https://stackoverflow.com/questions/17601662/how-to-build-qt-qoci-oracle-database-driver-on-windows-with-mingw
          Unless someone says otherwise....

          1 Reply Last reply
          1
          • A Offline
            A Offline
            Atiker
            wrote on 9 Dec 2017, 13:11 last edited by Atiker 12 Sept 2017, 13:11
            #5

            That article doesn`t work on my pc. Here is the mingw command line:
            C:\Qt\5.10.0\Src\qtbase\src\plugins\sqldrivers\oci>set INCLUDE=%INCLUDE%;C:\app\aliati\product\12.2.0\dbhome_1\oci\include

            C:\Qt\5.10.0\Src\qtbase\src\plugins\sqldrivers\oci>set LIB=%LIB%;C:\app\aliati\product\12.2.0\dbhome_1\oci\lib\msvc

            C:\Qt\5.10.0\Src\qtbase\src\plugins\sqldrivers\oci>qmake oci.pro

            C:\Qt\5.10.0\Src\qtbase\src\plugins\sqldrivers\oci>mingw32-make
            mingw32-make -f Makefile.Release
            mingw32-make[1]: Entering directory 'C:/Qt/5.10.0/Src/qtbase/src/plugins/sqldrivers/oci'
            mingw32-make[1]: Nothing to be done for 'first'.
            mingw32-make[1]: Leaving directory 'C:/Qt/5.10.0/Src/qtbase/src/plugins/sqldrivers/oci'

            C:\Qt\5.10.0\Src\qtbase\src\plugins\sqldrivers\oci>

            J 1 Reply Last reply 9 Dec 2017, 13:14
            0
            • A Atiker
              9 Dec 2017, 13:11

              That article doesn`t work on my pc. Here is the mingw command line:
              C:\Qt\5.10.0\Src\qtbase\src\plugins\sqldrivers\oci>set INCLUDE=%INCLUDE%;C:\app\aliati\product\12.2.0\dbhome_1\oci\include

              C:\Qt\5.10.0\Src\qtbase\src\plugins\sqldrivers\oci>set LIB=%LIB%;C:\app\aliati\product\12.2.0\dbhome_1\oci\lib\msvc

              C:\Qt\5.10.0\Src\qtbase\src\plugins\sqldrivers\oci>qmake oci.pro

              C:\Qt\5.10.0\Src\qtbase\src\plugins\sqldrivers\oci>mingw32-make
              mingw32-make -f Makefile.Release
              mingw32-make[1]: Entering directory 'C:/Qt/5.10.0/Src/qtbase/src/plugins/sqldrivers/oci'
              mingw32-make[1]: Nothing to be done for 'first'.
              mingw32-make[1]: Leaving directory 'C:/Qt/5.10.0/Src/qtbase/src/plugins/sqldrivers/oci'

              C:\Qt\5.10.0\Src\qtbase\src\plugins\sqldrivers\oci>

              J Offline
              J Offline
              JonB
              wrote on 9 Dec 2017, 13:14 last edited by JonB 12 Sept 2017, 13:14
              #6

              @Atiker

              mingw32-make[1]: Entering directory 'C:/Qt/5.10.0/Src/qtbase/src/plugins/sqldrivers/oci'
              mingw32-make[1]: Nothing to be done for 'first'.

              So, have you either looked to see what is already present in that directory, or made sure you've done a full "clean" before building? Why does it say nothing to be done for 'first'? You can look at the makefile.

              Or wait for someone else to come here and tell you exactly what to do.....

              1 Reply Last reply
              0
              • A Offline
                A Offline
                Atiker
                wrote on 9 Dec 2017, 13:24 last edited by
                #7

                Let me just reinstall Qt and try it again!:((

                J 1 Reply Last reply 9 Dec 2017, 13:34
                1
                • A Atiker
                  9 Dec 2017, 13:24

                  Let me just reinstall Qt and try it again!:((

                  J Offline
                  J Offline
                  JonB
                  wrote on 9 Dec 2017, 13:34 last edited by
                  #8

                  @Atiker
                  Worth a try :)

                  Take this with a pinch of salt --- bearing in mind I know nothing --- but:

                  set LIB=%LIB%;C:\app\aliati\product\12.2.0\dbhome_1\oci\lib\msvc

                  Is that msvc at the end right for mingw? I thought msvc was for Microsoft VC libs? But don't get hung up on this, as it's only something which might look odd to me....

                  1 Reply Last reply
                  1
                  • A Offline
                    A Offline
                    Atiker
                    wrote on 11 Dec 2017, 02:07 last edited by
                    #9

                    There is another error encountered :((
                    C:\Qt\5.10.0\mingw53_32>cd C:\Qt\5.10.0\Src\qtbase\src\plugins\sqldrivers\oci

                    C:\Qt\5.10.0\Src\qtbase\src\plugins\sqldrivers\oci>set INCLUDE=%INCLUDE%;C:\app\aliati\product\12.2.0\dbhome_1\oci\include

                    C:\Qt\5.10.0\Src\qtbase\src\plugins\sqldrivers\oci>set LIB=%LIB%;C:\app\aliati\product\12.2.0\dbhome_1\oci\lib\msvc

                    C:\Qt\5.10.0\Src\qtbase\src\plugins\sqldrivers\oci>qmake oci.pro
                    Cannot read C:/Qt/5.10.0/Src/qtbase/src/plugins/sqldrivers/qtsqldrivers-config.pri: The system cannot find the file specified.
                    Project ERROR: Library 'oci' is not defined.

                    AnyHelp.exec();

                    jsulmJ 1 Reply Last reply 11 Dec 2017, 05:40
                    0
                    • A Atiker
                      11 Dec 2017, 02:07

                      There is another error encountered :((
                      C:\Qt\5.10.0\mingw53_32>cd C:\Qt\5.10.0\Src\qtbase\src\plugins\sqldrivers\oci

                      C:\Qt\5.10.0\Src\qtbase\src\plugins\sqldrivers\oci>set INCLUDE=%INCLUDE%;C:\app\aliati\product\12.2.0\dbhome_1\oci\include

                      C:\Qt\5.10.0\Src\qtbase\src\plugins\sqldrivers\oci>set LIB=%LIB%;C:\app\aliati\product\12.2.0\dbhome_1\oci\lib\msvc

                      C:\Qt\5.10.0\Src\qtbase\src\plugins\sqldrivers\oci>qmake oci.pro
                      Cannot read C:/Qt/5.10.0/Src/qtbase/src/plugins/sqldrivers/qtsqldrivers-config.pri: The system cannot find the file specified.
                      Project ERROR: Library 'oci' is not defined.

                      AnyHelp.exec();

                      jsulmJ Offline
                      jsulmJ Offline
                      jsulm
                      Lifetime Qt Champion
                      wrote on 11 Dec 2017, 05:40 last edited by
                      #10

                      @Atiker You can't use libraries for MSVC compiler with MinGW and other way around.

                      https://forum.qt.io/topic/113070/qt-code-of-conduct

                      1 Reply Last reply
                      1
                      • A Offline
                        A Offline
                        Atiker
                        wrote on 11 Dec 2017, 09:12 last edited by
                        #11

                        Is there any other appropriate method to build QOCI driver?

                        1 Reply Last reply
                        0
                        • Pablo J. RoginaP Offline
                          Pablo J. RoginaP Offline
                          Pablo J. Rogina
                          wrote on 11 Dec 2017, 20:08 last edited by
                          #12

                          @Atiker said in Oracle database connection failure:

                          Project ERROR: Library 'oci' is not defined.

                          Have you taken a look at this post?

                          Also this bug report may help you.

                          Just in case, have you have properly installed Oracle supporting libraries?

                          Upvote the answer(s) that helped you solve the issue
                          Use "Topic Tools" button to mark your post as Solved
                          Add screenshots via postimage.org
                          Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

                          1 Reply Last reply
                          2

                          1/12

                          9 Dec 2017, 12:01

                          • Login

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