Lines Matching refs:db

79     sqlite3* const db;
86 SQLiteConnection(sqlite3* db, int openFlags, const String8& path, const String8& label) :
87 db(db), openFlags(openFlags), path(path), label(label), canceled(false) { }
130 sqlite3* db;
131 int err = sqlite3_open_v2(path.string(), &db, sqliteFlags, NULL);
138 if ((sqliteFlags & SQLITE_OPEN_READWRITE) && sqlite3_db_readonly(db, NULL)) {
139 throw_sqlite3_exception(env, db, "Could not open the database in read/write mode.");
140 sqlite3_close(db);
145 err = sqlite3_busy_timeout(db, BUSY_TIMEOUT_MS);
147 throw_sqlite3_exception(env, db, "Could not set busy timeout");
148 sqlite3_close(db);
153 err = register_android_functions(db, UTF16_STORAGE);
155 throw_sqlite3_exception(env, db, "Could not register Android SQL functions.");
156 sqlite3_close(db);
161 SQLiteConnection* connection = new SQLiteConnection(db, openFlags, path, label);
165 sqlite3_trace(db, &sqliteTraceCallback, connection);
168 sqlite3_profile(db, &sqliteProfileCallback, connection);
171 ALOGV("Opened connection %p with label '%s'", db, label.string());
179 ALOGV("Closing connection %p", connection->db);
180 int err = sqlite3_close(connection->db);
183 ALOGE("sqlite3_close(%p) failed: %d", connection->db, err);
184 throw_sqlite3_exception(env, connection->db, "Count not close db.");
256 int err = sqlite3_create_function_v2(connection->db, name, numArgs, SQLITE_UTF16,
264 throw_sqlite3_exception(env, connection->db);
274 int err = register_localized_collators(connection->db, locale, UTF16_STORAGE);
278 throw_sqlite3_exception(env, connection->db);
289 int err = sqlite3_prepare16_v2(connection->db,
304 throw_sqlite3_exception(env, connection->db, message);
309 ALOGV("Prepared statement %p on connection %p", statement, connection->db);
321 ALOGV("Finalized statement %p on connection %p", statement, connection->db);
372 throw_sqlite3_exception(env, connection->db, NULL);
383 throw_sqlite3_exception(env, connection->db, NULL);
394 throw_sqlite3_exception(env, connection->db, NULL);
409 throw_sqlite3_exception(env, connection->db, NULL);
423 throw_sqlite3_exception(env, connection->db, NULL);
437 throw_sqlite3_exception(env, connection->db, NULL);
447 throw_sqlite3_exception(env, connection->db);
466 return err == SQLITE_DONE ? sqlite3_changes(connection->db) : -1;
475 return err == SQLITE_DONE && sqlite3_changes(connection->db) > 0
476 ? sqlite3_last_insert_rowid(connection->db) : -1;
482 throw_sqlite3_exception(env, connection->db);
677 throw_sqlite3_exception(env, connection->db, msg.string());
687 throw_sqlite3_exception(env, connection->db, msg.string());
736 throw_sqlite3_exception(env, connection->db, "retrycount exceeded");
744 throw_sqlite3_exception(env, connection->db);
767 sqlite3_db_status(connection->db, SQLITE_DBSTATUS_LOOKASIDE_USED, &cur, &unused, 0);
782 sqlite3_progress_handler(connection->db, 4, sqliteProgressHandlerCallback,
785 sqlite3_progress_handler(connection->db, 0, NULL, NULL);