Hi all.

It is difficult to debug user functions with SQLiteJDBC. For example I 
have got a NullPointerException, but I don't know, why.

So… it is easy if you want to handle it. Just add to the Function.java:

    private static Throwable lastException;
    public static Throwable getLastException() {
        Throwable e = lastException;
        lastException = null;
        return e;
    }
    final protected void internalxFunc() throws SQLException {
        try {
            xFunc();
        } catch (Throwable e) {
            lastException = e;
            throw new SQLException(e.getMessage());
        }
    }


And call internalxFunc() instead of xFunc() in the Nested/Native driver.
Add in DB.java (on line 274)

    case SQLITE_LOCKED:
        throw new SQLException("database locked");
    case SQLITE_MISUSE:
        throw new SQLException(errmsg());
    default:
        finalize(stmt);
    * *   SQLException exception = new SQLException(errmsg());*
        exception.initCause(Function.getLastException());
    *    throw exception;*
    *


And similar with xStep() and xFinal().

Thank you for SQLiteJDBC and thank you for reading my email.

Just one thing: in JDBC world value_<type>() it not familiar. Why don't 
use *get<type>()*? And *setResult(…)* instead of result(…)?

Thank you again,
Máté.


--~--~---------~--~----~------------~-------~--~----~
Mailing List: http://groups.google.com/group/sqlitejdbc?hl=en
To unsubscribe, send email to [EMAIL PROTECTED]
-~----------~----~----~----~------~----~------~--~---

Reply via email to