本文整理匯總了Java中android.database.sqlite.SQLiteStatement.bindLong方法的典型用法代碼示例。如果您正苦於以下問題:Java SQLiteStatement.bindLong方法的具體用法?Java SQLiteStatement.bindLong怎麽用?Java SQLiteStatement.bindLong使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.database.sqlite.SQLiteStatement
的用法示例。
在下文中一共展示了SQLiteStatement.bindLong方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: bindValues
import android.database.sqlite.SQLiteStatement; //導入方法依賴的package包/類
@Override
protected final void bindValues(SQLiteStatement stmt, SMS entity) {
stmt.clearBindings();
Long id = entity.getId();
if (id != null) {
stmt.bindLong(1, id);
}
String time = entity.getTime();
if (time != null) {
stmt.bindString(2, time);
}
String address = entity.getAddress();
if (address != null) {
stmt.bindString(3, address);
}
String content = entity.getContent();
if (content != null) {
stmt.bindString(4, content);
}
stmt.bindDouble(5, entity.getProbability());
}
示例2: bindValues
import android.database.sqlite.SQLiteStatement; //導入方法依賴的package包/類
/** @inheritdoc */
@Override
protected void bindValues(SQLiteStatement stmt, BLinkedAccount entity) {
stmt.clearBindings();
Long id = entity.getId();
if (id != null) {
stmt.bindLong(1, id);
}
String Token = entity.getToken();
if (Token != null) {
stmt.bindString(2, Token);
}
Integer type = entity.getType();
if (type != null) {
stmt.bindLong(3, type);
}
Long BUserDaoId = entity.getBUserDaoId();
if (BUserDaoId != null) {
stmt.bindLong(4, BUserDaoId);
}
}
示例3: bindValues
import android.database.sqlite.SQLiteStatement; //導入方法依賴的package包/類
@Override
protected final void bindValues(SQLiteStatement stmt, Bpm entity) {
stmt.clearBindings();
Long id = entity.getId();
if (id != null) {
stmt.bindLong(1, id);
}
String mBpm = entity.getMBpm();
if (mBpm != null) {
stmt.bindString(2, mBpm);
}
String mTime = entity.getMTime();
if (mTime != null) {
stmt.bindString(3, mTime);
}
String mDescription = entity.getMDescription();
if (mDescription != null) {
stmt.bindString(4, mDescription);
}
}
示例4: bindValues
import android.database.sqlite.SQLiteStatement; //導入方法依賴的package包/類
@Override
protected final void bindValues(SQLiteStatement stmt, SearchNameBean entity) {
stmt.clearBindings();
Long id = entity.getId();
if (id != null) {
stmt.bindLong(1, id);
}
String searchname = entity.getSearchname();
if (searchname != null) {
stmt.bindString(2, searchname);
}
}
示例5: bindValues
import android.database.sqlite.SQLiteStatement; //導入方法依賴的package包/類
@Override
protected final void bindValues(SQLiteStatement stmt, RelationSource2 entity) {
stmt.clearBindings();
Long id = entity.getId();
if (id != null) {
stmt.bindLong(1, id);
}
Long toOneId = entity.getToOneId();
if (toOneId != null) {
stmt.bindLong(2, toOneId);
}
}
示例6: updateItemLabel
import android.database.sqlite.SQLiteStatement; //導入方法依賴的package包/類
public void updateItemLabel(int itemId, String newLabel)
{
Log.d(L.TAG, "Updating label of item " + itemId + " to " + newLabel);
SQLiteDatabase db = helper.getWritableDatabase();
SQLiteStatement stmt = db.compileStatement("update items set label=? where id=?");
stmt.bindString(1, newLabel);
stmt.bindLong(2, itemId);
stmt.execute();
stmt.close();
db.close();
}
示例7: bindValues
import android.database.sqlite.SQLiteStatement; //導入方法依賴的package包/類
@Override
protected final void bindValues(SQLiteStatement stmt, SimpleEntityNotNull entity) {
stmt.clearBindings();
stmt.bindLong(1, entity.getId());
stmt.bindLong(2, entity.getSimpleBoolean() ? 1L: 0L);
stmt.bindLong(3, entity.getSimpleByte());
stmt.bindLong(4, entity.getSimpleShort());
stmt.bindLong(5, entity.getSimpleInt());
stmt.bindLong(6, entity.getSimpleLong());
stmt.bindDouble(7, entity.getSimpleFloat());
stmt.bindDouble(8, entity.getSimpleDouble());
stmt.bindString(9, entity.getSimpleString());
stmt.bindBlob(10, entity.getSimpleByteArray());
}
示例8: performSetItem
import android.database.sqlite.SQLiteStatement; //導入方法依賴的package包/類
private boolean performSetItem(String key, String value, boolean isPersistent, boolean allowRetryWhenFull) {
SQLiteDatabase database = mDatabaseSupplier.getDatabase();
if (database == null) {
return false;
}
WXLogUtils.d(WXSQLiteOpenHelper.TAG_STORAGE, "set k-v to storage(key:" + key + ",value:" + value + ",isPersistent:" + isPersistent + ",allowRetry:" + allowRetryWhenFull + ")");
String sql = "INSERT OR REPLACE INTO " + WXSQLiteOpenHelper.TABLE_STORAGE + " VALUES (?,?,?,?);";
SQLiteStatement statement = null;
String timeStamp = WXSQLiteOpenHelper.sDateFormatter.format(new Date());
try {
statement = database.compileStatement(sql);
statement.clearBindings();
statement.bindString(1, key);
statement.bindString(2, value);
statement.bindString(3, timeStamp);
statement.bindLong(4, isPersistent ? 1 : 0);
statement.execute();
return true;
} catch (Exception e) {
WXLogUtils.e(WXSQLiteOpenHelper.TAG_STORAGE, "DefaultWXStorage occurred an exception when execute setItem :" + e.getMessage());
if (e instanceof SQLiteFullException) {
if (allowRetryWhenFull && trimToSize()) {
//try again
//setItem/setItemPersistent method only allow try once when occurred a sqliteFullException.
WXLogUtils.d(WXSQLiteOpenHelper.TAG_STORAGE, "retry set k-v to storage(key:" + key + ",value:" + value + ")");
return performSetItem(key, value, isPersistent, false);
}
}
return false;
} finally {
if(statement != null) {
statement.close();
}
}
}
示例9: bindValues
import android.database.sqlite.SQLiteStatement; //導入方法依賴的package包/類
@Override
protected final void bindValues(SQLiteStatement stmt, Banner entity) {
stmt.clearBindings();
stmt.bindLong(1, entity.getId());
String url = entity.getUrl();
if (url != null) {
stmt.bindString(2, url);
}
String type = entity.getType();
if (type != null) {
stmt.bindString(3, type);
}
}
示例10: updateLocation
import android.database.sqlite.SQLiteStatement; //導入方法依賴的package包/類
public void updateLocation(LocationModel locationModel) {
SQLiteDatabase db = this.getWritableDatabase();
SQLiteStatement stmt = db.compileStatement(Constants.UPDATE_TABLE_LOCATION);
stmt.bindString(1, locationModel.getName());
stmt.bindDouble(2, locationModel.getLongitude());
stmt.bindDouble(3, locationModel.getLatitude());
stmt.bindString(4, locationModel.getAddress());
stmt.bindString(5, locationModel.getDescription());
stmt.bindLong(6, locationModel.getId());
stmt.execute();
}
示例11: bindValues
import android.database.sqlite.SQLiteStatement; //導入方法依賴的package包/類
@Override
protected final void bindValues(SQLiteStatement stmt, ToOneTarget2 entity) {
stmt.clearBindings();
Long id = entity.getId();
if (id != null) {
stmt.bindLong(1, id);
}
}
示例12: bindValues
import android.database.sqlite.SQLiteStatement; //導入方法依賴的package包/類
@Override
protected final void bindValues(SQLiteStatement stmt, User entity) {
stmt.clearBindings();
Long id = entity.getId();
if (id != null) {
stmt.bindLong(1, id);
}
String userName = entity.getUserName();
if (userName != null) {
stmt.bindString(2, userName);
}
}
示例13: bindValues
import android.database.sqlite.SQLiteStatement; //導入方法依賴的package包/類
@Override
protected final void bindValues(SQLiteStatement stmt, BookMarkUser entity) {
stmt.clearBindings();
stmt.bindString(1, entity.getLogin());
String name = entity.getName();
if (name != null) {
stmt.bindString(2, name);
}
String avatarUrl = entity.getAvatarUrl();
if (avatarUrl != null) {
stmt.bindString(3, avatarUrl);
}
Integer followers = entity.getFollowers();
if (followers != null) {
stmt.bindLong(4, followers);
}
Integer following = entity.getFollowing();
if (following != null) {
stmt.bindLong(5, following);
}
java.util.Date markTime = entity.getMarkTime();
if (markTime != null) {
stmt.bindLong(6, markTime.getTime());
}
}
示例14: insertUserMessage
import android.database.sqlite.SQLiteStatement; //導入方法依賴的package包/類
private static void insertUserMessage(@NonNull SQLiteStatement statement,
long userId, long messageId) {
statement.bindLong(1, userId);
statement.bindLong(2, messageId);
statement.executeInsert();
statement.clearBindings();
}
示例15: updateListLabel
import android.database.sqlite.SQLiteStatement; //導入方法依賴的package包/類
public void updateListLabel(int listId, String newLabel)
{
Log.d(L.TAG, "Updating label of list " + listId + " to " + newLabel);
SQLiteDatabase db = helper.getWritableDatabase();
SQLiteStatement stmt = db.compileStatement("update lists set label=? where id=?");
stmt.bindString(1, newLabel);
stmt.bindLong(2, listId);
stmt.execute();
stmt.close();
db.close();
}