当前位置: 首页>>代码示例>>Java>>正文


Java SQLiteUtils.execSql方法代码示例

本文整理汇总了Java中com.activeandroid.util.SQLiteUtils.execSql方法的典型用法代码示例。如果您正苦于以下问题:Java SQLiteUtils.execSql方法的具体用法?Java SQLiteUtils.execSql怎么用?Java SQLiteUtils.execSql使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.activeandroid.util.SQLiteUtils的用法示例。


在下文中一共展示了SQLiteUtils.execSql方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: fixUpTable

import com.activeandroid.util.SQLiteUtils; //导入方法依赖的package包/类
private static void fixUpTable() {
    if (patched) return;
    String[] patchup = {
            "CREATE TABLE PebbleMovement (_id INTEGER PRIMARY KEY AUTOINCREMENT);",
            "ALTER TABLE PebbleMovement ADD COLUMN timestamp INTEGER;",
            "ALTER TABLE PebbleMovement ADD COLUMN metric INTEGER;",
            "CREATE UNIQUE INDEX index_PebbleMovement_timestamp on PebbleMovement(timestamp);"};

    for (String patch : patchup) {
        try {
            SQLiteUtils.execSql(patch);
            //  UserError.Log.e(TAG, "Processed patch should not have succeeded!!: " + patch);
        } catch (Exception e) {
            //  UserError.Log.d(TAG, "Patch: " + patch + " generated exception as it should: " + e.toString());
        }
    }
    patched = true;
}
 
开发者ID:jamorham,项目名称:xDrip-plus,代码行数:19,代码来源:StepCounter.java

示例2: fixUpTable

import com.activeandroid.util.SQLiteUtils; //导入方法依赖的package包/类
private static void fixUpTable() {
    if (patched) return;
    String[] patchup = {
            "CREATE TABLE HeartRate (_id INTEGER PRIMARY KEY AUTOINCREMENT);",
            "ALTER TABLE HeartRate ADD COLUMN timestamp INTEGER;",
            "ALTER TABLE HeartRate ADD COLUMN bpm INTEGER;",
            "ALTER TABLE HeartRate ADD COLUMN accuracy INTEGER;",
            "CREATE UNIQUE INDEX index_HeartRate_timestamp on HeartRate(timestamp);"};

    for (String patch : patchup) {
        try {
            SQLiteUtils.execSql(patch);
            //  UserError.Log.e(TAG, "Processed patch should not have succeeded!!: " + patch);
        } catch (Exception e) {
            //  UserError.Log.d(TAG, "Patch: " + patch + " generated exception as it should: " + e.toString());
        }
    }
    patched = true;
}
 
开发者ID:NightscoutFoundation,项目名称:xDrip,代码行数:20,代码来源:HeartRate.java

示例3: fixUpTable

import com.activeandroid.util.SQLiteUtils; //导入方法依赖的package包/类
private static void fixUpTable() {
    if (patched) return;
    final String[] patchup = {
            "CREATE TABLE BloodTest (_id INTEGER PRIMARY KEY AUTOINCREMENT);",
            "ALTER TABLE BloodTest ADD COLUMN timestamp INTEGER;",
            "ALTER TABLE BloodTest ADD COLUMN created_timestamp INTEGER;",
            "ALTER TABLE BloodTest ADD COLUMN state INTEGER;",
            "ALTER TABLE BloodTest ADD COLUMN mgdl REAL;",
            "ALTER TABLE BloodTest ADD COLUMN source TEXT;",
            "ALTER TABLE BloodTest ADD COLUMN uuid TEXT;",
            "CREATE UNIQUE INDEX index_Bloodtest_uuid on BloodTest(uuid);",
            "CREATE UNIQUE INDEX index_Bloodtest_timestamp on BloodTest(timestamp);",
            "CREATE INDEX index_Bloodtest_created_timestamp on BloodTest(created_timestamp);",
            "CREATE INDEX index_Bloodtest_state on BloodTest(state);"};

    for (String patch : patchup) {
        try {
            SQLiteUtils.execSql(patch);
            //  UserError.Log.e(TAG, "Processed patch should not have succeeded!!: " + patch);
        } catch (Exception e) {
            //  UserError.Log.d(TAG, "Patch: " + patch + " generated exception as it should: " + e.toString());
        }
    }
    patched = true;
}
 
开发者ID:jamorham,项目名称:xDrip-plus,代码行数:26,代码来源:BloodTest.java

示例4: execute

import com.activeandroid.util.SQLiteUtils; //导入方法依赖的package包/类
public <T extends Model> List<T> execute() {
	if (mQueryBase instanceof Select) {
		return SQLiteUtils.rawQuery(mType, toSql(), getArguments());
		
	} else {
		SQLiteUtils.execSql(toSql(), getArguments());
		Cache.getContext().getContentResolver().notifyChange(ContentProvider.createUri(mType, null), null);
		return null;
		
	}
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:12,代码来源:From.java

示例5: deleteALL

import com.activeandroid.util.SQLiteUtils; //导入方法依赖的package包/类
public static void deleteALL() {
    try {
        SQLiteUtils.execSql("delete from BgSendQueue");
        SQLiteUtils.execSql("delete from BgReadings");
        Log.d(TAG, "Deleting all BGReadings");
    } catch (Exception e) {
        Log.e(TAG, "Got exception running deleteALL " + e.toString());
    }
}
 
开发者ID:jamorham,项目名称:xDrip-plus,代码行数:10,代码来源:BgReading.java

示例6: fixUpTable

import com.activeandroid.util.SQLiteUtils; //导入方法依赖的package包/类
public static void fixUpTable() {
    if (patched) return;

    for (String patch : schema) {
        try {
            SQLiteUtils.execSql(patch);
        } catch (Exception e) {
            if (d)
                UserError.Log.d(TAG, "Patch: " + patch + " generated exception as it should: " + e.toString());
        }
    }
    patched = true;
}
 
开发者ID:NightscoutFoundation,项目名称:xDrip,代码行数:14,代码来源:UserNotification.java

示例7: fixUpTable

import com.activeandroid.util.SQLiteUtils; //导入方法依赖的package包/类
protected synchronized static void fixUpTable(String[] schema) {
    if (patched) return;
    for (String patch : schema) {
        try {
            SQLiteUtils.execSql(patch);
        } catch (Exception e) {
            //
        }
    }
    patched = true;
}
 
开发者ID:jamorham,项目名称:xDrip-plus,代码行数:12,代码来源:Reminder.java

示例8: fixUpTable

import com.activeandroid.util.SQLiteUtils; //导入方法依赖的package包/类
protected synchronized static void fixUpTable(String[] schema) {
    if (patched) return;

    for (String patch : schema) {
        try {
            SQLiteUtils.execSql(patch);
        } catch (Exception e) {
            //
        }
    }
    patched = true;
}
 
开发者ID:NightscoutFoundation,项目名称:xDrip,代码行数:13,代码来源:PlusModel.java

示例9: cleanup

import com.activeandroid.util.SQLiteUtils; //导入方法依赖的package包/类
public static void cleanup(long timestamp) {
    try {
    SQLiteUtils.execSql("delete from BgSendQueue");
    List<BgReading> data = new Select()
            .from(BgReading.class)
            .where("timestamp < ?", timestamp)
            .orderBy("timestamp desc")
            .execute();
    if (data != null) Log.d(TAG, "cleanup BgReading size=" + data.size());
    new Cleanup().execute(data);
    } catch (Exception e) {
        Log.e(TAG, "Got exception running cleanup " + e.toString());
    }
}
 
开发者ID:NightscoutFoundation,项目名称:xDrip,代码行数:15,代码来源:BgReading.java

示例10: updateDB

import com.activeandroid.util.SQLiteUtils; //导入方法依赖的package包/类
public static void updateDB(){
    String[] updates = new String[]{"ALTER TABLE BgReadings ADD COLUMN dg_mgdl REAL;", "ALTER TABLE BgReadings ADD COLUMN dg_slope REAL;", "ALTER TABLE BgReadings ADD COLUMN dg_delta_name TEXT;"};
    for (String patch:updates) {
        try {
            SQLiteUtils.execSql(patch);
        } catch (Exception e){
        }
    }

}
 
开发者ID:jamorham,项目名称:xDrip-plus,代码行数:11,代码来源:BgReading.java

示例11: fixUpTable

import com.activeandroid.util.SQLiteUtils; //导入方法依赖的package包/类
protected synchronized static boolean fixUpTable(String[] schema, boolean patched) {
    if (patched) return true;

    for (String patch : schema) {
        try {
            SQLiteUtils.execSql(patch);
        } catch (Exception e) {
            //
        }
    }
    return true;
}
 
开发者ID:NightscoutFoundation,项目名称:xDrip,代码行数:13,代码来源:PlusModel.java

示例12: execute

import com.activeandroid.util.SQLiteUtils; //导入方法依赖的package包/类
public <T extends Model> List<T> execute() {
	if (mQueryBase instanceof Select) {
		return SQLiteUtils.rawQuery(mType, toSql(), getArguments());
	}
	else {
		SQLiteUtils.execSql(toSql(), getArguments());
		Cache.getContext().getContentResolver().notifyChange(ContentProvider
				.createUri(mType, null), null);
		return null;
	}
}
 
开发者ID:DobrinAlexandru,项目名称:Wabbit-Messenger---android-client,代码行数:12,代码来源:From.java

示例13: execute

import com.activeandroid.util.SQLiteUtils; //导入方法依赖的package包/类
public void execute() {
	SQLiteUtils.execSql(toSql(), getArguments());
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:4,代码来源:Set.java


注:本文中的com.activeandroid.util.SQLiteUtils.execSql方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。