[Qt-jambi-interest] Unable to utilize SQLite

Eskil Abrahamsen Blomfeldt eblomfel at trolltech.com
Tue May 27 08:28:45 CEST 2008


Matt 0000 wrote:
>  
> Attempting to use qsqlite4.dll found in 
> <QTJambi-Home>\plugins\sqldrivers in an independant Eclipse project 
> loosely based on the com\trolltech\examples\CachedTable.java without 
> much success owing to error:
> "Missing support for SQL"
>  
Hi, Matt.

In order to use the native plugins in your Qt Jambi application, you 
need to tell Qt Jambi where to look for them. There are a few ways of 
doing this in the 4.3 series.

1. You can set your QT_PLUGIN_PATH environment variable to 
"<QTJambi-Home>\plugins". If the sqlite4.dll file is contained in a 
subdirectory called sqldrivers, it will be loaded.

2. This may not be the best solution for deployment, so you can also 
packaging the contents of <QTJambi-Home>\plugins into a .jar file and 
then passing the argument 
-Dcom.trolltech.qt.pluginjars=[name_of_jarfile] to the JVM when you 
launch it.

3. The way it works in the Qt Jambi Demo Launcher is that <current 
directory>\plugins is added as a library path in code in order to get 
access to the plugins.
 From the code in Launcher.java:
   
    QApplication.addLibraryPath(new QFileInfo(".").absoluteFilePath() + 
"/plugins");

For development I'd recommend just using solution 1, and for deployment 
I'd recommend using solution 2.

Please note that the deployment mechanism in Qt Jambi has changed in 
version 4.4, so these suggestions only apply for the 4.3 series. Here's 
some more in-depth information about deploying Qt Jambi applications 
with Qt Jambi 4.3:

    
http://doc.trolltech.com/qtjambi-4.3.4_01/doc/html/com/trolltech/qt/qtjambi-deployment.html

(PS. A fourth solution specific to SQL drivers would be to get a JDBC 
driver for SQLite and downloading the QJdbc project which is available 
on Trolltech Labs: http://labs.trolltech.com/page/Projects/QtJambi/JDBC. 
We have, however, had reports that the JDBC support for SQLite has some 
limitations. QJdbc will be a part of Qt Jambi 4.4.)

-- Eskil


More information about the Qt-jambi-interest mailing list