Results 1 to 7 of 7

Thread: how to open a OCI db connection?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2012
    Location
    Argentina
    Posts
    167
    Thanks
    33
    Thanked 10 Times in 10 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default how to open a OCI db connection?

    hi guys its me again, im trying to start a connection to an oracle database (11g) i have in my computer. The thing is i really dont know how to do it, even though i ve read the threads here in this forum with no luck...

    here is the information i have:

    problem4.jpg

    here is the code:

    Qt Code:
    1. db = QSqlDatabase::addDatabase ("QOCI");
    2. db.setDatabaseName("XE");
    3. db.setUserName("KillGabio");
    4. db.setPassword("killlll");
    5. db.setHostName("global-0cbe695d");
    6. db.setPort(1521);
    7. if (db.open ()){
    8. QSqlQuery query (db);
    9. if( !query.exec("SELECT * FROM TABLE_PRODUCTOS") )
    10. qDebug() << query.lastError();
    11. else
    12. qDebug( "Selected!" );
    13. return true;}
    14. else{
    15. QMessageBox::critical(0, qApp->tr("Cannot open database"),
    16. qApp->tr("Unable to establish a database connection.\n"
    17. "Llamar a Agus.\n\n"
    18. "Click Cancel to exit."), QMessageBox::Cancel);
    19. return false;
    20. }
    To copy to clipboard, switch view to plain text mode 

    and finally the error i get:

    NOD32 protected [MSAFD Tcpip [TCP/IP]]NOD32 protected [MSAFD Tcpip [UDP/IP]]NOD32 protected [MSAFD Tcpip [RAW/IP]]NOD32 protected [RSVP UDP Service Provider]NOD32 protected [RSVP TCP Service Provider]Selected!
    i disabled nod32 but no luck i dont know what it.

    Thank u all in advance and im trying to learn
    Last edited by KillGabio; 21st January 2012 at 00:31.

Similar Threads

  1. Replies: 0
    Last Post: 11th November 2011, 19:18
  2. Replies: 3
    Last Post: 25th August 2010, 12:39
  3. Replies: 1
    Last Post: 2nd April 2010, 06:42
  4. connection is not open
    By emental86 in forum Qt Programming
    Replies: 3
    Last Post: 1st December 2008, 22:04
  5. How do I keep the client connection open ?
    By probine in forum Newbie
    Replies: 2
    Last Post: 25th March 2006, 19:06

Tags for this Thread

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.