Code example for SQLiteDatabase

Methods: beginTransactionNonExclusiveendTransactiongetVersionsetTransactionSuccessful

0
            // Not much we can do to recover at this point 
            Log.e(LOGTAG, "Unable to open or create " + databaseFile);
            return; 
        } 
 
        if (mDatabase.getVersion() != DATABASE_VERSION) {
            mDatabase.beginTransactionNonExclusive();
            try { 
                createTable(); 
                mDatabase.setTransactionSuccessful();
            } finally { 
                mDatabase.endTransaction();
            } 
        } 
    } 
 
    private void createTable() { 
        mDatabase.execSQL("CREATE TABLE " + HTTPAUTH_TABLE_NAME
                + " (" + ID_COL + " INTEGER PRIMARY KEY, "
                + HTTPAUTH_HOST_COL + " TEXT, " + HTTPAUTH_REALM_COL
Experience pair programming with AI  Get Codota for Java