/** * Close this object and release any resources associated with it. The behavior of calling * <code>insert()</code> after calling this method is undefined. */ public void close() { if (mInsertStatement != null) { mInsertStatement.close(); mInsertStatement = null; } if (mReplaceStatement != null) { mReplaceStatement.close(); mReplaceStatement = null; } mInsertSQL = null; mColumns = null; }
/** * Utility method to run the query on the db and return the value in the first column of the first * row. */ public static String stringForQuery(SQLiteDatabase db, String query, String[] selectionArgs) { SQLiteStatement prog = db.compileStatement(query); try { return stringForQuery(prog, selectionArgs); } finally { prog.close(); } }