[Qt-interest] Runtime configuration of database drivers

Bill KING bill.king at trolltech.com
Fri Jan 9 04:00:01 CET 2009


Robert Hairgrove wrote:
> (opensource Qt-4.4.3)
>
> Two questions:
>
> (1) When a stand-alone application is running on a client's PC, how can 
> the application "know" which databases are already installed? I have 
> configured my compilation for as many databases as are allowed by the 
> opensource version. These are MySQL, ODBC, PostgreSQL and SQLite.
>
> The only one of these guaranteed to work on any machine is SQLite 
> because it is compiled into Qt itself. All the others rely on shared 
> libraries which might or might not be there. However, if someone wants 
> to use PostgreSQL, for example, it is available.
>
> Do we just try to connect at runtime and catch the error? Try to load 
> the required libraries and see if they fail? Or is it better to provide 
> support for the drivers as plugins?
>
>   
I'd do the second, if there are missing libraries, it seems to silently
fail to load the plugin on unix at least. Not sure how it goes on windows.

-- 
Bill King, Software Engineer
Qt Software, Nokia Pty Ltd
Brisbane Office




More information about the Qt-interest-old mailing list