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?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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,QSqlQueryandQSqlResultat the forefront, there are some abstractions that also insulate you from actual SQLQSqlTableModelandQSqlRelationalTableModelbut those are geared for use in any of the Qt views. There is also a classQDataWidgetMapperthat 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
QSqlRecordand we useQSqlTableModelfor 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.