Home | History | Annotate | Download | only in jni

Lines Matching defs:connection

48  * If another connection (possibly in another process) has the database locked for
53 * have a single open connection at a time unless they are using WAL. When using
54 * WAL, a timeout could occur if one connection is busy performing an auto-checkpoint
95 SQLiteConnection* connection = static_cast<SQLiteConnection*>(data);
97 connection->label.string(), sql);
102 SQLiteConnection* connection = static_cast<SQLiteConnection*>(data);
104 connection->label.string(), sql, tm * 0.000001f);
109 SQLiteConnection* connection = static_cast<SQLiteConnection*>(data);
110 return connection->canceled;
175 SQLiteConnection* connection = new SQLiteConnection(db, openFlags, path, label);
179 sqlite3_trace(db, &sqliteTraceCallback, connection);
182 sqlite3_profile(db, &sqliteProfileCallback, connection);
185 ALOGV("Opened connection %p with label '%s'", db, label.string());
186 return reinterpret_cast<jlong>(connection);
190 SQLiteConnection* connection = reinterpret_cast<SQLiteConnection*>(connectionPtr);
192 if (connection) {
193 ALOGV("Closing connection %p", connection->db);
194 int err = sqlite3_close(connection->db);
197 ALOGE("sqlite3_close(%p) failed: %d", connection->db, err);
198 throw_sqlite3_exception(env, connection->db, "Count not close db.");
202 delete connection;
261 SQLiteConnection* connection = reinterpret_cast<SQLiteConnection*>(connectionPtr);
270 int err = sqlite3_create_function_v2(connection->db, name, numArgs, SQLITE_UTF16,
278 throw_sqlite3_exception(env, connection->db);
285 SQLiteConnection* connection = reinterpret_cast<SQLiteConnection*>(connectionPtr);
288 int err = register_localized_collators(connection->db, locale, UTF16_STORAGE);
292 throw_sqlite3_exception(env, connection->db);
298 SQLiteConnection* connection = reinterpret_cast<SQLiteConnection*>(connectionPtr);
303 int err = sqlite3_prepare16_v2(connection->db,
318 throw_sqlite3_exception(env, connection->db, message);
323 ALOGV("Prepared statement %p on connection %p", statement, connection->db);
329 SQLiteConnection* connection = reinterpret_cast<SQLiteConnection*>(connectionPtr);
335 ALOGV("Finalized statement %p on connection %p", statement, connection->db);
377 SQLiteConnection* connection = reinterpret_cast<SQLiteConnection*>(connectionPtr);
382 throw_sqlite3_exception(env, connection->db, NULL);
388 SQLiteConnection* connection = reinterpret_cast<SQLiteConnection*>(connectionPtr);
393 throw_sqlite3_exception(env, connection->db, NULL);
399 SQLiteConnection* connection = reinterpret_cast<SQLiteConnection*>(connectionPtr);
404 throw_sqlite3_exception(env, connection->db, NULL);
410 SQLiteConnection* connection = reinterpret_cast<SQLiteConnection*>(connectionPtr);
419 throw_sqlite3_exception(env, connection->db, NULL);
425 SQLiteConnection* connection = reinterpret_cast<SQLiteConnection*>(connectionPtr);
433 throw_sqlite3_exception(env, connection->db, NULL);
439 SQLiteConnection* connection = reinterpret_cast<SQLiteConnection*>(connectionPtr);
447 throw_sqlite3_exception(env, connection->db, NULL);
451 static int executeNonQuery(JNIEnv* env, SQLiteConnection* connection, sqlite3_stmt* statement) {
457 throw_sqlite3_exception(env, connection->db);
464 SQLiteConnection* connection = reinterpret_cast<SQLiteConnection*>(connectionPtr);
467 executeNonQuery(env, connection, statement);
472 SQLiteConnection* connection = reinterpret_cast<SQLiteConnection*>(connectionPtr);
475 int err = executeNonQuery(env, connection, statement);
476 return err == SQLITE_DONE ? sqlite3_changes(connection->db) : -1;
481 SQLiteConnection* connection = reinterpret_cast<SQLiteConnection*>(connectionPtr);
484 int err = executeNonQuery(env, connection, statement);
485 return err == SQLITE_DONE && sqlite3_changes(connection->db) > 0
486 ? sqlite3_last_insert_rowid(connection->db) : -1;
489 static int executeOneRowQuery(JNIEnv* env, SQLiteConnection* connection, sqlite3_stmt* statement) {
492 throw_sqlite3_exception(env, connection->db);
499 SQLiteConnection* connection = reinterpret_cast<SQLiteConnection*>(connectionPtr);
502 int err = executeOneRowQuery(env, connection, statement);
511 SQLiteConnection* connection = reinterpret_cast<SQLiteConnection*>(connectionPtr);
514 int err = executeOneRowQuery(env, connection, statement);
561 SQLiteConnection* connection = reinterpret_cast<SQLiteConnection*>(connectionPtr);
564 int err = executeOneRowQuery(env, connection, statement);
679 SQLiteConnection* connection = reinterpret_cast<SQLiteConnection*>(connectionPtr);
687 throw_sqlite3_exception(env, connection->db, msg.string());
697 throw_sqlite3_exception(env, connection->db, msg.string());
746 throw_sqlite3_exception(env, connection->db, "retrycount exceeded");
754 throw_sqlite3_exception(env, connection->db);
781 SQLiteConnection* connection = reinterpret_cast<SQLiteConnection*>(connectionPtr);
785 sqlite3_db_status(connection->db, SQLITE_DBSTATUS_LOOKASIDE_USED, &cur, &unused, 0);
790 SQLiteConnection* connection = reinterpret_cast<SQLiteConnection*>(connectionPtr);
791 connection->canceled = true;
796 SQLiteConnection* connection = reinterpret_cast<SQLiteConnection*>(connectionPtr);
797 connection->canceled = false;
800 sqlite3_progress_handler(connection->db, 4, sqliteProgressHandlerCallback,
801 connection);
803 sqlite3_progress_handler(connection->db, 0, NULL, NULL);