Results 1 to 12 of 12

Thread: How do I get Qt to recognize the oci driver.

  1. #1
    Join Date
    Jul 2008
    Posts
    33
    Thanks
    7
    Qt products
    Qt4
    Platforms
    Windows

    Default How do I get Qt to recognize the oci driver.

    Now whenever I try to open the database, it says I don't have OCI support. It says I do have the QSQLLite driver but that is it. I look in the /plugins/sqldrivers directory and it has 2 drivers there, the oci and sqllite drivers. How do I get Qt to recognize the oci driver. I have multiple copies of Qt, but I have set everything up to look at the one with the driver. What do I need to do to make Qt recognize the OCI driver? Thanks!!

  2. #2
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How do I get Qt to recognize the oci driver.

    put "sqldrivers" directory (with its content) near yours executable.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  3. #3
    Join Date
    Jul 2008
    Posts
    33
    Thanks
    7
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How do I get Qt to recognize the oci driver.

    Thanks!
    I waited for one day and look for the solution.
    My os is solaris 10 and oracle is 10g,I want to known that do these can work tegether?

  4. #4
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How do I get Qt to recognize the oci driver.

    what do you mean "I want to known that do these can work tegether?"
    I have compiled Qt with OCI under windows and SuSE 11 and on both platforms Qt works fine with Oracle 10g.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  5. #5
    Join Date
    Jul 2008
    Posts
    33
    Thanks
    7
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How do I get Qt to recognize the oci driver.

    I mean that weather oracle 10g can work on salaris10.
    Could you please tell me how can I use oracel10g on saloris 10.
    when i connect to oracle ,it always show warning : oci driver not load.
    but I have compiled oracle plugins libqsqloci.so.
    How can I make Qt recognize the oci driver?

  6. #6
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How do I get Qt to recognize the oci driver.

    did you set path to Oracle lib?
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  7. #7
    Join Date
    Jul 2008
    Posts
    33
    Thanks
    7
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How do I get Qt to recognize the oci driver.

    the path is:
    LD_LIBRARY_PATH=/usr/dt/lib:/usr/lib:/usr/openwin/lib:/usr/local/lib:/export/home/powerDMS/QT4.3.4/lib:/export/home/powerDMS/bin:/usr/sfw/lib:.

  8. #8
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How do I get Qt to recognize the oci driver.

    I don't see path to Oracle libs. should be something like this ORACLE_HOME/lib.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  9. The following user says thank you to spirit for this useful post:

    yleesun (16th January 2009)

  10. #9
    Join Date
    Jul 2008
    Posts
    33
    Thanks
    7
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How do I get Qt to recognize the oci driver.

    Thanks!
    Now I set the oracle path as this:
    LD_LIBRARY_PATH=/usr/dt/lib:/usr/lib:/usr/openwin/lib:/usr/local/lib:/export/home/
    powerDMS/QT4.3.4/lib:/usr/sfw/lib:/export/home/oracle/10g/lib:.
    But ,it still doesnot work.Driver not loaded!!
    Is there anything of QT must be configured?

  11. #10
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How do I get Qt to recognize the oci driver.

    try to rebuild OCI plugin again.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  12. #11
    Join Date
    Dec 2008
    Posts
    29
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: How do I get Qt to recognize the oci driver.

    To be able to use OCI QtSql driver, you have to have

    1) instaled Oracle Instant Client (for g++.ver => 4.1 (i'm not sure now with exact version nr.) use 11g, for older 10g, 10g oracle libraries are compiled with older version of ABI, than newer g++ provides - it could be linkable, but you would get strange behaviour and runtime application sigsegvs); so install rpm packages of: oracle-instantclient-{basic,devel,sqlplus} - it contains base oci libraries and header files you will need to compile QtSql driver

    2) create /etc/env.d/99oracle contaning sth. like this ():
    ORACLE_HOME=/usr/lib/oracle/10.2.0.3
    #ORACLE_SID=
    ORACLE_TERM=xterm
    ORACLE_OWNER=oracle
    TNS_ADMIN=/usr/lib/oracle/10.2.0.3/network/admin
    #NLS_LANG=
    #ORA_NLS10=
    LD_LIBRARY_PATH=/usr/lib/oracle/10.2.0.3/client/lib
    DISABLE_HUGETLBFS=1
    PATH=/usr/lib/oracle/10.2.0.3/client/bin
    ROOTPATH=/usr/lib/oracle/10.2.0.3/client/bin
    LDPATH=/usr/lib/oracle/10.2.0.3/client/lib:/usr/kde/3.5/lib
    TZ=GMT

    3) create $TNS_ADMIN/sql.ora
    TRACE_LEVEL_CLIENT = OFF
    sqlnet.expire_time = 30
    NAMES.DIRECTORY_PATH=(TNSNAMES)

    4) create $TNS_ADMIN/tnsnames.ora
    ##connection_identifier## = (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP) (HOST=dbserver)(PORT= 1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SID=##XE## )))

    5) add "##IP## dbserver" to /etc/hosts

    6) check connection to your db server with sqlplus: sqlplus user/password@//server[ort]/db_name

    7) check connection to your db server with connection_identifier you have set in (4): sqlplus user/password@connection_identifier
    => you need this, because Oracle QtSql driver uses TNSNAMES for connecting to server

    8) compile Qt with support of OCI driver; it should be set with some parameter of configurate script + you have to specify also the path to your oracle libraries (sometimes is better to create links from oracle libraries to /lib

    9) test connection from your program:
    #include <QtCore>
    #include <QtDebug>
    #include <QtSql>
    int main ( int argc, char *argv[] )
    {
    QCoreApplication app ( argc, argv );
    QSqlDatabase db = QSqlDatabase::addDatabase ( "QOCI8", "test_connection" );
    db.setDatabaseName ( "connection_identifier" ); // TNS - viz. TNSNAMES.ORA
    // db.setHostName ( "" ); // without hn, we use TNS
    // db.setPort ( 1521 ); // without port, we use TNS
    db.setUserName ( "user" );
    db.setPassword ( "password" );
    bool ok = db.open();
    if (ok)
    qDebug("OK.");
    else
    qDebug("%s", qPrintable(db.lastError().text()));
    return 0;
    }


    I wish you good luck, there are many holes, you can broke your bones with QtSql Oracle driver... (many errors, single thread environment setting, etc.)

  13. The following user says thank you to seim for this useful post:

    yleesun (19th January 2009)

  14. #12
    Join Date
    Jul 2008
    Posts
    33
    Thanks
    7
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How do I get Qt to recognize the oci driver.

    Thank you a lot.

Similar Threads

  1. mysql driver not loaded after deployment
    By tpf80 in forum Newbie
    Replies: 4
    Last Post: 4th September 2011, 10:12
  2. Help with QMYSQL driver for QT 4.4.0: driver not loaded
    By khikho in forum Installation and Deployment
    Replies: 4
    Last Post: 1st April 2011, 15:00
  3. SQLite driver unavailable
    By kandalf in forum Installation and Deployment
    Replies: 5
    Last Post: 11th February 2009, 16:36
  4. Locating a driver on the operating system
    By schall_l in forum Qt Programming
    Replies: 2
    Last Post: 15th July 2008, 09:19
  5. regarding a touch screen driver for qt-embedded
    By sar_van81 in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 2nd March 2007, 10:23

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.