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 connect a Oracle Aunonomus Database
Forum Updated to NodeBB v4.3 + New Features

How to connect a Oracle Aunonomus Database

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 579 Views 2 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.
  • VirulanaV Offline
    VirulanaV Offline
    Virulana
    wrote on last edited by
    #1

    Hi,

    Can someone help me with the connection to the Oracle Cloud from Qt.

    I can't find any information on the Qt website, nor examples, but surely someone has wanted to connect to an instance of autonomous database, with Qt.

    I already connect with SqlDeveloper, with SqlCl, I just need to be able to do it with Qt, because I can't find the way

    Thank you very much !

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

      Hi and welcome to devnet,

      Did you already check the QOCI database driver ?

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

      VirulanaV 2 Replies Last reply
      0
      • SGaistS SGaist

        Hi and welcome to devnet,

        Did you already check the QOCI database driver ?

        VirulanaV Offline
        VirulanaV Offline
        Virulana
        wrote on last edited by
        #3

        @SGaist

        Hi, thank you for your cooperation

        Yes, it charges perfectly. My problem is how to write the connection.
        My code is as follows,

        QCoreApplication a(argc, argv);

        QSqlDatabase db = QSqlDatabase::addDatabase("QOCI");

        db.setDatabaseName("db20220323123926_high");
        db.setUserName("ADMIN");
        db.setPassword(“12345678”);
        db.setConnectOptions("OCI_ATTR_PREFETCH_ROWS=1000");

        if (!db.open())
        {
        Error("%s", db.lastError().text().toLatin1().data());
        return 0;
        }

        it loads the driver (I see it in the log) and it takes a while to connect. Then it indicates the following error:

        ORA-28759: failure to open file. Unable to logon

        The TNS LISTENER environment variable, points to the folder where the tnsnames.ora (connection) and sqlnet.ora (wallet location) files are.

        the permissions of the wallet files are correct

        I'm still looking for information...

        1 Reply Last reply
        0
        • SGaistS SGaist

          Hi and welcome to devnet,

          Did you already check the QOCI database driver ?

          VirulanaV Offline
          VirulanaV Offline
          Virulana
          wrote on last edited by
          #4

          @SGaist
          I managed to get it to work, I had a write error in sqlnet.ora (don't do these things at 3AM)

          Thank you for all

          1 Reply Last reply
          1
          • Kent-DorfmanK Offline
            Kent-DorfmanK Offline
            Kent-Dorfman
            wrote on last edited by
            #5

            I do my best work at 3AM....mark as solved?

            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