Hello,

I have spent time testing jambi 4.4 preview and I was disappointed to see
the sqlite dll disappear from the distribution. I understand that it was
certainly removed due to the new QJdbc facility.

I have tried the following JDBC driver : http://www.zentus.com/sqlitejdbc/

and initialized it with the following code:

QJdbc.initialize();

try {
      Class.forName("org.sqlite.JDBC").newInstance();
} catch (Exception ex) { System.err.println(ex); return; }

but at my first attempt of sql, I get the following error:
SQLite only supports TYPE_FORWARD_ONLY cursors (null)

Do you know what is going on ?
Regards.


Here is the code to reproduce the problem:

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

public class TestSqliteJDBC {

    public static void main(String[] args) {
        QApplication.initialize(args);
        QJdbc.initialize();
        try {
            Class.forName("org.sqlite.JDBC").newInstance();
        } catch (Exception ex) { System.err.println(ex); return; }


        QSqlDatabase db = QSqlDatabase.addDatabase(QJdbc.ID, "test");
        if (db == null) {
            System.out.println("db is null");
        }
        if (!db.isValid()) {
            System.out.println("db is not valid");
            }

        String strDbFilename = "database.db";
        db.setDatabaseName("jdbc:sqlite:"+strDbFilename);
        if (!db.open()) {
            System.out.println("db is not opened");
        }
        if (db.isOpenError()) {
            System.out.println("db had an open error");
        }

        QSqlQuery query = new QSqlQuery(db);
        query.exec("create table IF NOT EXISTS genericmetadatas (id INTEGER
PRIMARY KEY AUTOINCREMENT, docid int, groupid varchar(255), key
varchar(255), value varchar(255))");
        if (!query.isActive()) {
            System.out.println("creating table genericmetadatas"+
query.lastError().text());
        }

        db.removeDatabase("test");
    }
}
_______________________________________________
Qt-jambi-interest mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt-jambi-interest

Reply via email to