Revert to previous method for SQLite, the new method doesn't seem to be working.

Also, be sure to close statements.