本文整理匯總了Java中net.sqlcipher.database.SQLiteProgram類的典型用法代碼示例。如果您正苦於以下問題:Java SQLiteProgram類的具體用法?Java SQLiteProgram怎麽用?Java SQLiteProgram使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
SQLiteProgram類屬於net.sqlcipher.database包,在下文中一共展示了SQLiteProgram類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: bindObjectToProgram
import net.sqlcipher.database.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());
}
}
示例2: Program
import net.sqlcipher.database.SQLiteProgram; //導入依賴的package包/類
Program(SQLiteProgram delegate) {
this.delegate=delegate;
}
示例3: SqlCipherProgram
import net.sqlcipher.database.SQLiteProgram; //導入依賴的package包/類
SqlCipherProgram(SQLiteProgram delegate) {
mDelegate = delegate;
}