I have successfully built QOCI plugin for Qt 4x on windows. Is there anyone that knows how to create connection to Oracle RAC (real application cluster)
for example something similar exists in jdbc thin driver
I have successfully built QOCI plugin for Qt 4x on windows. Is there anyone that knows how to create connection to Oracle RAC (real application cluster)
for example something similar exists in jdbc thin driver
If you set up your TNSNAMES correctly (and/or use TNS_ADMIN to point to it), then a QT app compiled with QOCI will use it to connect to any Oracle database, RAC or single instance.
Have you been able to connect to a database yet or is your question really "How do I code a connection to an Oracle Database?"
davidovv (29th September 2011)
If the client is correctly configured (TNSNAMES), you have to specify only databaseName (Service Name in ORACLE), userName and Password.
Qt Code:
db.setDatabaseName ("my_service"); db.setUsername ("my_user"); db.setPassword ("my_password"); if (db.open()) { // Connection Open }To copy to clipboard, switch view to plain text mode
For security reason you may prefer
Qt Code:
db.setDatabaseName ("my_service"); if (db.open("my_user", "my_password")) { // Connection Open }To copy to clipboard, switch view to plain text mode
because this QSqlDatabase::open() version doesn't store the password.
A camel can go 14 days without drink,
I can't!!!
davidovv (29th September 2011)
I connected succesfuly to database using its IP address....
Maybe these next questions are more oracle questions, and not for this thread but still...
what are the requirements for tnsnames, is oracle instantclient enough, or i need to install that 500mb client or even more?
Another question, is this RAC invisible to my application? For example after db.open i execute one query, it gets executed on one node, then that node fails, i execute another query. Is this second query executed on second node without any notification to my application (maybe just some delay), or I need to reconnect to db and to try again?
And thank you both, it is useful information that RAC connection can't be configured within my application only, more things need to be done.
instantclient is enough for you.
I think you have to reconnect when a node fails (OCI connections are TCP connections).
A camel can go 14 days without drink,
I can't!!!
davidovv (29th September 2011)
Bookmarks