How can download OCI Driver ?SOLVED
to all who try to connect to an Oracle database created with Express Edition this is howto:
Qt Code:
db.setDatabaseName("XE"); db.setUserName("admin"); db.setPassword("killllll"); db.setHostName("127.0.0.1"); db.setPort(1521); if (db.open ()){ if( !query.exec("SELECT * FROM TABLE_PRODUCTOS") ) qDebug() << query.lastError(); else qDebug( "Selected!" ); return true;} else{ qApp->tr("Unable to establish a database connection.\n" qDebug() << db.lastError (); return false; }db = QSqlDatabase::addDatabase ("QOCI"); db.setDatabaseName("XE"); db.setUserName("admin"); db.setPassword("killllll"); db.setHostName("127.0.0.1"); db.setPort(1521); if (db.open ()){ QSqlQuery query (db); if( !query.exec("SELECT * FROM TABLE_PRODUCTOS") ) qDebug() << query.lastError(); else qDebug( "Selected!" ); return true;} else{ QMessageBox::critical(0, qApp->tr("Cannot open database"), qApp->tr("Unable to establish a database connection.\n" "Click Cancel to exit."), QMessageBox::Cancel); qDebug() << db.lastError (); return false; }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!
I not found link download
Please help me.
Bookmarks