--- Begin Message ---
El Monday 25 August 2008 01:04:10 Gunnar Sletta escribió:
> José Arcángel Salazar Delgado wrote:
> > Hi,
> > I'm having troubles trying to use the QIBASE driver. With Qt jambi 4.3, I
> > only need to compile the driver from QT 4.3 and put it in the
> > /plugins/sqldrivers dir. But with qt jambi 4.4 I don't know what to do,
> > because the same trick did't  work. I'm using QT 4.4+mingw, qtjambi 4.4
> > on windows XP and firebird 2.1.
>
> You stumbled onto two issues here.
>
> First of all, the open source packages are built with visual studio,
> because that is the only way to support the DirectX libraries needed by
> our multimedia support, Phonon. It is not possible to load plugins
> compiled using mingw together with a Qt that is built with MSVC, because
> binary incompatibilities. The Qt plugin loader will check this before
> accepting any C++ plugins.
>
> The second thing is that if you are using the qtjambi-win32-msvc2005.jar
> platform jarfile, we load plugins from this, rather than from the
> plugins directory.
>
> If you want to do the old approach, you need to build Qt using Mingw,
> build Jambi using mingw, build your driver and not use the platform .jar
> file. Alternatively you could modify the ant task generating the
> platform jarfile to include your driver, of course.
>
> > I didn't use the QJDBC driver (using jaybird) because its incompatible
> > with qt jambi.
>
> We haven't tested this internally, so there could be issues here. Could
> you be a bit more spesific?
>
> best regards,
> Gunnar

Upss, that sounds like a lot of work.
For now, I returned to the old Qt jambi (4.3)  because I don't have the time 
and the software to do the recompilation.

And this is the problem that I have with the jaybird driver:

package com.linuxsoluciones.prueba;

import com.trolltech.qt.sql.QJdbc;
import com.trolltech.qt.sql.QSqlDatabase;
import com.trolltech.qt.sql.QSqlQuery;

public class DataBase {
        private static QSqlDatabase db;
        
        public static boolean crearConexion(){
                System.out.println("DataBase.crearConexion()");
                boolean res;
                QJdbc.initialize();
                
        try {
                Class.forName("org.firebirdsql.jdbc.FBDriver");
        } 
        catch (Exception ex) { 
                System.err.println(ex); 
        }
        db = QSqlDatabase.addDatabase(QJdbc.ID);
        
db.setDatabaseName("jdbc:firebirdsql:www.linuxsoluciones.com/3050:/tmp/prueba.fdb");
        db.setUserName("sysdba");
        db.setPassword("147258");
        
        if (db.open()) {
            System.out.println("Conexión realizada!");
            res= true;
        } else {
            System.err.println("Conexión fallida!");
            System.err.println(db.lastError().text());
            res = false;
        }
        QSqlQuery query = new QSqlQuery();
        query.exec("CREATE TABLE clientes(nombres varchar(10)");
        System.out.println(query.lastError().text());
        
            return res;
        }
}

package com.linuxsoluciones.prueba;

import com.trolltech.qt.core.QCoreApplication;
import com.trolltech.qt.gui.*;

public class PruebaWidget extends QWidget {

    Ui_PruebaWidget ui = new Ui_PruebaWidget();

    public static void main(String[] args) {
        QCoreApplication.initialize(args);
        if(!DataBase.crearConexion()){
                System.err.println("error de conexión");
                
        }
        System.exit(0);
    }

}
 And this is the result of the execution:

DataBase.crearConexion()
Conexión realizada!
not yet implemented (null) Unable to execute query

As you can see, the problem is the incomplete JDBC driver for firebird.
In my personal opinion, I think that you need to check the compatibility of 
the QJDBC, because most of the available drivers for opensource databases 
(derby, sqlite, firebird, smallsqli, etc.) don't implement the parts of the 
standards that you use.
For now, I'm unable to use sqlite or firebird in my projects with qt jambi 
4.4.

Thanks for the help.

--- End Message ---
_______________________________________________
Qt-jambi-interest mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt-jambi-interest

Reply via email to