/cts/tests/tests/database/src/android/database/sqlite/cts/ |
SQLiteDatabaseTest.java | 44 private SQLiteDatabase mDatabase; 75 mDatabase = SQLiteDatabase.openOrCreateDatabase(mDatabaseFile, null); 76 assertNotNull(mDatabase); 85 mDatabase.close(); 164 mDatabase.execSQL("CREATE TABLE test (num INTEGER);"); 165 mDatabase.execSQL("INSERT INTO test (num) VALUES (0)"); 173 assertFalse(mDatabase.inTransaction()); 174 mDatabase.beginTransaction(); 175 assertTrue(mDatabase.inTransaction()); 177 mDatabase.setTransactionSuccessful() [all...] |
DatabaseStatementTest.java | 44 private SQLiteDatabase mDatabase; 51 mDatabase = getContext().openOrCreateDatabase(DATABASE_NAME, Context.MODE_PRIVATE, null); 52 assertNotNull(mDatabase); 53 mDatabase.setVersion(CURRENT_DATABASE_VERSION); 58 mDatabase.close(); 73 mDatabase.execSQL("CREATE TABLE test (_id INTEGER PRIMARY KEY, data TEXT);"); 75 mDatabase.execSQL("INSERT INTO test (data) VALUES ('" + sString1 + "');"); 76 mDatabase.execSQL("INSERT INTO test (data) VALUES ('" + sString2 + "');"); 77 mDatabase.execSQL("INSERT INTO test (data) VALUES ('" + sString3 + "');"); 83 SQLiteStatement statement = mDatabase.compileStatement("DELETE FROM test") [all...] |
SQLiteStatementTest.java | 51 private SQLiteDatabase mDatabase; 58 mDatabase = getContext().openOrCreateDatabase(DATABASE_NAME, Context.MODE_PRIVATE, null); 59 assertNotNull(mDatabase); 60 mDatabase.setVersion(CURRENT_DATABASE_VERSION); 65 mDatabase.close(); 71 mDatabase.execSQL("CREATE TABLE test (_id INTEGER PRIMARY KEY, data TEXT);"); 75 mDatabase.execSQL("CREATE TABLE blob_test (_id INTEGER PRIMARY KEY, data BLOB)"); 80 mDatabase.insert("blob_test", null, values); 85 mDatabase.disableWriteAheadLogging(); 88 assertEquals(0, DatabaseUtils.longForQuery(mDatabase, "select count(*) from test", null)) [all...] |
SQLiteProgramTest.java | 33 private SQLiteDatabase mDatabase; 40 mDatabase = getContext().openOrCreateDatabase(DATABASE_NAME, Context.MODE_PRIVATE, null); 41 assertNotNull(mDatabase); 46 mDatabase.close(); 53 mDatabase.execSQL("CREATE TABLE test (_id INTEGER PRIMARY KEY, text1 TEXT, text2 TEXT, " + 55 mDatabase.execSQL("INSERT INTO test (text1, text2, num1, num2, image) " + 57 mDatabase.execSQL("INSERT INTO test (text1, text2, num1, num2, image) " + 61 statement = mDatabase.compileStatement("SELECT num1 FROM test WHERE num2 = ?;"); 70 statement = mDatabase.compileStatement("SELECT text1 FROM test WHERE text2 = ?;"); 92 cursor = mDatabase.query("test", new String[]{"text1"}, "where text1='a'" [all...] |
SQLiteCursorTest.java | 37 private SQLiteDatabase mDatabase; 50 mDatabase = getContext().openOrCreateDatabase(DATABASE_FILE, Context.MODE_PRIVATE, null); 57 mDatabase.close(); 63 SQLiteDirectCursorDriver cursorDriver = new SQLiteDirectCursorDriver(mDatabase, 66 new SQLiteCursor(mDatabase, cursorDriver, TABLE_NAME, null); 147 mDatabase.execSQL(DELETE_1); 155 mDatabase.execSQL(DELETE_2); 166 mDatabase.disableWriteAheadLogging(); 167 mDatabase.execSQL("create table testRequery2 (i int);"); 168 mDatabase.execSQL("insert into testRequery2 values(1);") [all...] |
SQLiteFtsTest.java | 41 private SQLiteDatabase mDatabase; 46 mDatabase = getContext().openOrCreateDatabase("CTS_FTS", Context.MODE_PRIVATE, null); 52 final String path = mDatabase.getPath(); 53 mDatabase.close(); 106 mDatabase.execSQL( 115 mDatabase.insert(table, null, values); 120 return mDatabase.query(table, new String[] { "snippet(" + table + ")" },
|
SQLiteQueryBuilderTest.java | 36 private SQLiteDatabase mDatabase; 46 mDatabase = getContext().openOrCreateDatabase(DATABASE_FILE, Context.MODE_PRIVATE, null); 47 assertNotNull(mDatabase); 52 mDatabase.close(); 124 mDatabase.execSQL("CREATE TABLE test (_id INTEGER PRIMARY KEY, " + 126 mDatabase.execSQL("INSERT INTO test (name, age, address) VALUES ('Mike', '20', 'LA');"); 127 mDatabase.execSQL("INSERT INTO test (name, age, address) VALUES ('jack', '40', 'LA');"); 131 Cursor cursor = sqliteQueryBuilder.query(mDatabase, new String[] { "name", "age" }, 144 cursor = sqliteQueryBuilder.query(mDatabase, new String[] { "name", "age" }, 205 Cursor cursor = sqliteQueryBuilder.query(mDatabase, [all...] |
/frameworks/base/core/tests/coretests/src/android/database/ |
DatabaseStressTest.java | 34 private SQLiteDatabase mDatabase; 47 mDatabase = c.openOrCreateDatabase("database_test.db", 0, null); 49 assertNotNull(mDatabase); 50 mDatabase.setVersion(CURRENT_DATABASE_VERSION); 52 mDatabase.execSQL("CREATE TABLE IF NOT EXISTS test (_id INTEGER PRIMARY KEY, data TEXT);"); 58 mDatabase.close(); 71 mDatabase.execSQL("INSERT INTO test (data) VALUES (?)", strArr); 72 mDatabase.execSQL("delete from test;"); 93 mDatabase.execSQL("INSERT INTO test (data) VALUES (?)", strArr);
|
DatabaseGeneralTest.java | 52 private SQLiteDatabase mDatabase; 63 mDatabase = SQLiteDatabase.openOrCreateDatabase(mDatabaseFile.getPath(), null); 64 assertNotNull(mDatabase); 65 mDatabase.setVersion(CURRENT_DATABASE_VERSION); 70 mDatabase.close(); 85 mDatabase.execSQL("CREATE TABLE test (_id INTEGER PRIMARY KEY, data TEXT);"); 87 mDatabase.execSQL("INSERT INTO test (data) VALUES ('" + sString1 + "');"); 88 mDatabase.execSQL("INSERT INTO test (data) VALUES ('" + sString2 + "');"); 89 mDatabase.execSQL("INSERT INTO test (data) VALUES ('" + sString3 + "');"); 94 assertEquals(CURRENT_DATABASE_VERSION, mDatabase.getVersion()) [all...] |
DatabaseStatementTest.java | 38 private SQLiteDatabase mDatabase; 50 mDatabase = SQLiteDatabase.openOrCreateDatabase(mDatabaseFile.getPath(), null); 51 assertNotNull(mDatabase); 52 mDatabase.setVersion(CURRENT_DATABASE_VERSION); 57 mDatabase.close(); 72 mDatabase.execSQL("CREATE TABLE test (_id INTEGER PRIMARY KEY, data TEXT);"); 74 mDatabase.execSQL("INSERT INTO test (data) VALUES ('" + sString1 + "');"); 75 mDatabase.execSQL("INSERT INTO test (data) VALUES ('" + sString2 + "');"); 76 mDatabase.execSQL("INSERT INTO test (data) VALUES ('" + sString3 + "');"); 82 SQLiteStatement statement = mDatabase.compileStatement("DELETE FROM test") [all...] |
DatabasePerformanceTests.java | 81 protected SQLiteDatabase mDatabase; 91 mDatabase = SQLiteDatabase.openOrCreateDatabase(mDatabaseFile.getPath(), null); 92 Assert.assertTrue(mDatabase != null); 93 mDatabase.setVersion(CURRENT_DATABASE_VERSION); 97 mDatabase.close(); 214 mDatabase 221 mDatabase.execSQL(statements[i]); 247 mDatabase 249 mDatabase.execSQL("CREATE INDEX i1c ON t1(c)"); 255 mDatabase.execSQL(statements[i]) [all...] |
NewDatabasePerformanceTests.java | 41 protected SQLiteDatabase mDatabase; 49 mDatabase = 52 assertTrue(mDatabase != null); 53 mDatabase.setVersion(CURRENT_DATABASE_VERSION); 57 mDatabase.close(); 123 mDatabase 129 mDatabase.execSQL(statements[i]); 155 mDatabase 157 mDatabase.execSQL("CREATE INDEX i1c ON t1(c)"); 162 mDatabase.execSQL(statements[i]) [all...] |
DatabaseLockTest.java | 38 private SQLiteDatabase mDatabase; 51 mDatabase = SQLiteDatabase.openOrCreateDatabase(mDatabaseFile.getPath(), null); 52 assertNotNull(mDatabase); 57 mDatabase.close(); 74 mDatabase.beginTransaction(); 85 mDatabase.endTransaction(); 101 mDatabase.beginTransaction(); 108 mDatabase.endTransaction(); 126 mDatabase.beginTransaction(); 138 mDatabase.endTransaction() [all...] |
DatabaseErrorHandlerTest.java | 33 private SQLiteDatabase mDatabase; 46 mDatabase = SQLiteDatabase.openOrCreateDatabase(mDatabaseFile.getPath(), null, 48 assertNotNull(mDatabase); 53 mDatabase.close(); 59 new MyDatabaseCorruptionHandler().onCorruption(mDatabase); 66 mDatabase.execSQL("create table t (i int);"); 75 mDatabase.execSQL("select * from t;");
|
DatabaseLocaleTest.java | 33 private SQLiteDatabase mDatabase; 48 mDatabase = SQLiteDatabase.create(null); 49 mDatabase.execSQL( 55 mDatabase.execSQL("INSERT INTO test (data) VALUES('" + s + "');"); 61 mDatabase.close(); 67 Cursor c = mDatabase.rawQuery(sql, null); 91 mDatabase.setLocale(new Locale("en", "US")); 114 mDatabase.execSQL("INSERT INTO test(id, data) VALUES(1, '" + expectedString + "')"); 115 cursor = mDatabase.rawQuery("SELECT data FROM test WHERE id = 1", null);
|
DatabaseCursorTest.java | 48 private SQLiteDatabase mDatabase; 60 mDatabase = SQLiteDatabase.openOrCreateDatabase(mDatabaseFile.getPath(), null); 61 assertNotNull(mDatabase); 62 mDatabase.setVersion(CURRENT_DATABASE_VERSION); 67 mDatabase.close(); 82 mDatabase.execSQL("CREATE TABLE test (_id INTEGER PRIMARY KEY, data TEXT);"); 84 mDatabase.execSQL("INSERT INTO test (data) VALUES ('" + sString1 + "');"); 85 mDatabase.execSQL("INSERT INTO test (data) VALUES ('" + sString2 + "');"); 86 mDatabase.execSQL("INSERT INTO test (data) VALUES ('" + sString3 + "');"); 92 mDatabase.execSQL [all...] |
/frameworks/base/core/tests/coretests/src/android/database/sqlite/ |
SQLiteCursorTest.java | 30 private SQLiteDatabase mDatabase; 42 mDatabase = SQLiteDatabase.openOrCreateDatabase(mDatabaseFile.getPath(), null); 43 assertNotNull(mDatabase); 45 mDatabase.execSQL("CREATE TABLE " + TABLE_NAME + " (i int, j int);"); 50 mDatabase.close(); 62 mDatabase.beginTransaction(); 63 mDatabase.execSQL("CREATE TABLE " + testTable + " (col1 int, desc text not null);"); 64 mDatabase.setTransactionSuccessful(); 65 mDatabase.endTransaction(); 82 mDatabase.beginTransaction() [all...] |
/frameworks/base/core/java/android/database/sqlite/ |
SQLiteOpenHelper.java | 59 private SQLiteDatabase mDatabase; 131 if (mDatabase != null && mDatabase.isOpen() && !mDatabase.isReadOnly()) { 133 mDatabase.enableWriteAheadLogging(); 135 mDatabase.disableWriteAheadLogging(); 193 if (mDatabase != null) { 194 if (!mDatabase.isOpen()) { 195 // Darn! The user closed the database by calling mDatabase.close(). 196 mDatabase = null [all...] |
SQLiteDirectCursorDriver.java | 29 private final SQLiteDatabase mDatabase; 37 mDatabase = db; 44 final SQLiteQuery query = new SQLiteQuery(mDatabase, mSql, mCancellationSignal); 52 cursor = factory.newCursor(mDatabase, this, mEditTable, query);
|
SQLiteProgram.java | 33 private final SQLiteDatabase mDatabase; 42 mDatabase = db; 84 return mDatabase; 101 return mDatabase.getThreadSession(); 106 return mDatabase.getThreadDefaultConnectionFlags(mReadOnly); 111 mDatabase.onCorruption();
|
/external/chromium_org/android_webview/java/src/org/chromium/android_webview/ |
HttpAuthDatabase.java | 35 private SQLiteDatabase mDatabase = null; 97 mDatabase = context.openOrCreateDatabase(databaseFile, 0, null); 101 mDatabase = context.openOrCreateDatabase(databaseFile, 0, null); 105 if (mDatabase == null) { 111 if (mDatabase.getVersion() != DATABASE_VERSION) { 112 mDatabase.beginTransactionNonExclusive(); 115 mDatabase.setTransactionSuccessful(); 117 mDatabase.endTransaction(); 123 mDatabase.execSQL("CREATE TABLE " + HTTPAUTH_TABLE_NAME 131 mDatabase.setVersion(DATABASE_VERSION) [all...] |
/cts/tests/tests/database/src/android/database/cts/ |
DatabaseUtilsTest.java | 43 private SQLiteDatabase mDatabase; 61 mDatabase = SQLiteDatabase.openOrCreateDatabase(mDatabaseFile.getPath(), null); 62 assertNotNull(mDatabase); 63 mDatabase.execSQL("CREATE TABLE " + TABLE_NAME + " (_id INTEGER PRIMARY KEY, " + 65 mDatabase.execSQL( 71 mDatabase.close(); 116 Cursor cursor = mDatabase.query(TABLE_NAME, TEST_PROJECTION, 122 SQLiteStatement statement = mDatabase.compileStatement(sql); 129 cursor = mDatabase.query(TABLE_NAME, TEST_PROJECTION, null, null, null, null, null); 158 mDatabase.execSQL("INSERT INTO " + TABLE_NAME + " (name, age, address)" [all...] |
DatabaseCursorTest.java | 48 private SQLiteDatabase mDatabase; 62 mDatabase = SQLiteDatabase.openOrCreateDatabase(mDatabaseFile.getPath(), null); 63 assertNotNull(mDatabase); 64 mDatabase.setVersion(CURRENT_DATABASE_VERSION); 69 mDatabase.close(); 98 mDatabase.execSQL("CREATE TABLE test (_id INTEGER PRIMARY KEY, data TEXT);"); 100 mDatabase.execSQL("INSERT INTO test (data) VALUES ('" + sString1 + "');"); 101 mDatabase.execSQL("INSERT INTO test (data) VALUES ('" + sString2 + "');"); 102 mDatabase.execSQL("INSERT INTO test (data) VALUES ('" + sString3 + "');"); 108 mDatabase.execSQL [all...] |
DatabaseUtils_InsertHelperTest.java | 32 private SQLiteDatabase mDatabase; 39 mDatabase = getContext().openOrCreateDatabase(DATABASE_NAME, Context.MODE_PRIVATE, null); 40 assertNotNull(mDatabase); 41 mInsertHelper = new InsertHelper(mDatabase, TEST_TABLE_NAME); 47 mDatabase.close(); 53 new InsertHelper(mDatabase, TEST_TABLE_NAME); 61 mDatabase.execSQL("CREATE TABLE " + TEST_TABLE_NAME + " (_id INTEGER PRIMARY KEY, " + 76 mDatabase.execSQL("CREATE TABLE " + TEST_TABLE_NAME + "(_id INTEGER PRIMARY KEY," + 100 Cursor cursor = mDatabase.query(TEST_TABLE_NAME, projection, null, null, null, null, null); 125 cursor = mDatabase.query(TEST_TABLE_NAME, projection, null, null, null, null, null) [all...] |
CursorWrapperTest.java | 48 private SQLiteDatabase mDatabase; 82 Cursor cursor = mDatabase.query("test1", NUMBER_PROJECTION, null, null, null, null, null); 91 addWithValue(mDatabase, TESTVALUE1); 95 addWithValue(mDatabase, TESTVALUE2); 101 deleteWithValue(mDatabase, TESTVALUE1); 104 deleteWithValue(mDatabase, TESTVALUE2); 109 deleteAllRecords(mDatabase); 299 mDatabase.execSQL("CREATE TABLE test2 (_id INTEGER PRIMARY KEY, string_text TEXT," 313 mDatabase.execSQL(sql, args); 315 Cursor cursor = mDatabase.query("test2", null, null, null, null, null, null) [all...] |