views:

342

answers:

1

I've been asked about using the QT database interface for Oracle. What's a good starting point for investigating this? Do you have any experience with it you can share?

+2  A: 

We have been using the QtSql classes for a couple of years now, we are currently using the ODBC driver to connect to MSSql instance. Overall the the whole interface performs it's taks reasonably well. It insulates you completely from the Database driver QSqlDatabase, QSqlQuery and QSqlResult at the forefront, there are some abstractions that also insulate you from actual SQL QSqlTableModel and QSqlRelationalTableModel but those are geared for use in any of the Qt views. There is also a class QDataWidgetMapper that helps you map data to non table views. Also QVariant does an excelent job of wrapping SQL data, and providing typed access to the result of a query. While all of this is very helpful, unless your application is small in scope it won't save you from having to come up with a decent DAO layer, none of the Qt classes provide that.

We have a process where we turn a - custom made - xml description into a sql script for creating a table, a qt wrapper class for QSqlRecord and we use QSqlTableModel for most of our CRUD work. That work reasonably well but there is a lot of overhead in these classes so I would not repeat this approach.

We did find some quirks with the ODBC driver, I am sure there are some other quirks with the oracle driver. OTOH we are reasonably sure that we will be able to switch from MS-SQL to ORACLE within a short amount of time.

As for starting points, I think there is a simple example in the qt examples.

Harald Scheirich
Could you elucidate on "quirks in the OBDC driver"? I'm thinking of switching over to Qt (away from MSFT's implementation), and wanted to know what to expect.
Eric H.