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


Java SQLiteProgram类代码示例

本文整理汇总了Java中android.database.sqlite.SQLiteProgram的典型用法代码示例。如果您正苦于以下问题:Java SQLiteProgram类的具体用法?Java SQLiteProgram怎么用?Java SQLiteProgram使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: bindObjectToProgram

import android.database.sqlite.SQLiteProgram; //导入依赖的package包/类
/**
 * Binds the given Object to the given SQLiteProgram using the proper
 * typing. For example, bind numbers as longs/doubles, and everything else
 * as a string by call toString() on it.
 *
 * @param prog  the program to bind the object to
 * @param index the 1-based index to bind at
 * @param value the value to bind
 */
public static void bindObjectToProgram(SQLiteProgram prog, int index, Object value) {
    if (value == null) {
        prog.bindNull(index);
    } else if (value instanceof Double || value instanceof Float) {
        prog.bindDouble(index, ((Number) value).doubleValue());
    } else if (value instanceof Number) {
        prog.bindLong(index, ((Number) value).longValue());
    } else if (value instanceof Boolean) {
        Boolean bool = (Boolean) value;
        if (bool) {
            prog.bindLong(index, 1);
        } else {
            prog.bindLong(index, 0);
        }
    } else if (value instanceof byte[]) {
        prog.bindBlob(index, (byte[]) value);
    } else {
        prog.bindString(index, value.toString());
    }
}
 
开发者ID:kkmike999,项目名称:YuiHatano,代码行数:30,代码来源:ShadowDatabaseUtils.java

示例2: bindObjectToProgram

import android.database.sqlite.SQLiteProgram; //导入依赖的package包/类
/**
 * Binds the given Object to the given SQLiteProgram using the proper
 * typing. For example, bind numbers as longs/doubles, and everything else
 * as a string by call toString() on it.
 *
 * @param prog the program to bind the object to
 * @param index the 1-based index to bind at
 * @param value the value to bind
 */
public static void bindObjectToProgram(SQLiteProgram prog, int index,
        Object value) {
    if (value == null) {
        prog.bindNull(index);
    } else if (value instanceof Double || value instanceof Float) {
        prog.bindDouble(index, ((Number)value).doubleValue());
    } else if (value instanceof Number) {
        prog.bindLong(index, ((Number)value).longValue());
    } else if (value instanceof Boolean) {
        Boolean bool = (Boolean)value;
        if (bool) {
            prog.bindLong(index, 1);
        } else {
            prog.bindLong(index, 0);
        }
    } else if (value instanceof byte[]){
        prog.bindBlob(index, (byte[]) value);
    } else {
        prog.bindString(index, value.toString());
    }
}
 
开发者ID:doppllib,项目名称:core-doppl,代码行数:31,代码来源:DatabaseUtils.java

示例3: bindArgumentsToProgram

import android.database.sqlite.SQLiteProgram; //导入依赖的package包/类
public static void bindArgumentsToProgram(SQLiteProgram program, Object[] sqlArgs) {
    if (sqlArgs == null) {
        return;
    }
    for (int i = 1; i <= sqlArgs.length; i++) {
        DatabaseUtils.bindObjectToProgram(program, i, sqlArgs[i - 1]);
    }
}
 
开发者ID:yahoo,项目名称:squidb,代码行数:9,代码来源:SquidCursorFactory.java

示例4: FrameworkSQLiteProgram

import android.database.sqlite.SQLiteProgram; //导入依赖的package包/类
FrameworkSQLiteProgram(SQLiteProgram delegate) {
    mDelegate = delegate;
}
 
开发者ID:albertogiunta,项目名称:justintrain-client-android,代码行数:4,代码来源:FrameworkSQLiteProgram.java

示例5: bindObjectToProgram

import android.database.sqlite.SQLiteProgram; //导入依赖的package包/类
public static void bindObjectToProgram(SQLiteProgram prog, int index, Object value)
{
    throw new RuntimeException("Stub!");
}
 
开发者ID:blackarbiter,项目名称:Android_Code_Arbiter,代码行数:5,代码来源:DatabaseUtils.java


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