Quote Originally Posted by KillGabio View Post
SOLVED

to all who try to connect to an Oracle database created with Express Edition this is howto:

Qt Code:
  1. db = QSqlDatabase::addDatabase ("QOCI");
  2. db.setDatabaseName("XE");
  3. db.setUserName("admin");
  4. db.setPassword("killllll");
  5. db.setHostName("127.0.0.1");
  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. "Click Cancel to exit."), QMessageBox::Cancel);
  18. qDebug() << db.lastError ();
  19. return false;
  20. }
To copy to clipboard, switch view to plain text mode 

in the Database name goes the SID not the name you gave it to the database, for the host you can either put LOCALHOST or the TCPIP dir (127.0.0.1)
the user and pass are the ones you create at the workespace and in the setPort you indicate the listener port, i think for all Oracle servers is 1521
hope this is helpfull to someone

greetings!
How can download OCI Driver ?
I not found link download
Please help me.