PDA

View Full Version : Fun with ODBC and Oracle


KaptainKarl
25th July 2007, 17:13
Hello,

I'm using QT 4.3 on Suse 10.

Up until now, I have been working with QT and MySQL and the experience has been a pleasant one. Now I am forced to connect to an Oracle database.

Since I develop on Suse 10 and Oracle does not have a client for Suse 10, I have been unable to find an oci library I could link into QT. So, I decided to try ODBC. I reconfigured and reinstalled QT with the -qt-sql-odbc switch. It configured, built, and installed.

I went to the sqlbrowser demo program and tried to connect to an Oracle database. I got the following error:

An error occured while opening the connection: [unixODBC][Driver Manager]Data source name not found, and no default driver specified QODBC3: Unable to connect

I then tried connecting to a local MySQL database and got the same error.

So what do I need to install to make this work?

Thanks,
Karl

jacek
26th July 2007, 02:14
You have to add a data source to unixODBC, but unfortunately I can't help you with this.

KaptainKarl
26th July 2007, 19:52
This does seem to be a bit of mystery where Suse is concerned. I made sure I have all the ODBC packages installed and unixODBC is among them, but what is missing is the ODBCconfig program which allows you set up Data Sources.

Does anyone know where I can get a version of the Oracle OCI libraries that I could then link with QT to create a QOCI driver in Suse 10?

Karl

jacek
27th July 2007, 12:38
I made sure I have all the ODBC packages installed and unixODBC is among them, but what is missing is the ODBCconfig program which allows you set up Data Sources.
In my distribution, there's separate package with unixODBC tools. AFAIK its equivalent in in SuSE is called unixODBC-gui-qt.

Does anyone know where I can get a version of the Oracle OCI libraries that I could then link with QT to create a QOCI driver in Suse 10?
QOCI driver is available with commercial edition of Qt, because Oracle drivers aren't compatible with GPL. According to the docs (http://doc.trolltech.com/4.3/sql-driver.html#qoci-for-the-oracle-call-interface-oci), you need "Instant Client Package - Basic" and "Instant Client Package - SDK" (http://www.oracle.com/technology/tech/oci/instantclient/index.html).

KaptainKarl
27th July 2007, 22:42
Thanks. I was typing the name incorrectly (ODBCconfig instead of ODBCConfig). I ran into a little trouble with an indefined reference but I downloaded a newer version and it worked.

The Oracle Instant Client also worked so I have an Oracle driver built in as well.

Karl