[SQLiteJDBC] Prepared statements closing prematurely?

Daniel Peebles pumpkingod at gmail.com
Tue Aug 23 13:13:44 EDT 2011


I was encountering an odd error from the sqlite-jdbc code, saying "statement
is not executing". After poking around the source code, it turns out that
you get that error message if the underlying sqlite handle is null (a bit of
an odd error message for that situation). Googling that message shows that
several other people have encountered it, and nobody seems to understand it.

I poked around the code some more and found that every execute* method in
Stmt closes the statement, causing the above error. This seems to defeat
much of the purpose of prepared statements, since it effectively means each
prepared statement can only be used once (or am I missing something).

Is there a reason every execute* call starts with a call to close() on the
Stmt? It seems that simply removing the close() would make this work as
expected for me and many others.

Thank you,
Daniel Peebles


More information about the SQLiteJDBC mailing list