當前位置: 首頁>>代碼示例>>Java>>正文


Java SQLiteStatement.bindLong方法代碼示例

本文整理匯總了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());
}
 
開發者ID:InnoFang,項目名稱:FamilyBond,代碼行數:26,代碼來源:SMSDao.java

示例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);
    }
}
 
開發者ID:MobileDev418,項目名稱:AndroidBackendlessChat,代碼行數:26,代碼來源:BLinkedAccountDao.java

示例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);
    }
}
 
開發者ID:InnoFang,項目名稱:FamilyBond,代碼行數:25,代碼來源:BpmDao.java

示例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);
    }
}
 
開發者ID:popo1379,項目名稱:popomusic,代碼行數:15,代碼來源:SearchNameBeanDao.java

示例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);
    }
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:15,代碼來源:RelationSource2Dao.java

示例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();
}
 
開發者ID:sdrausty,項目名稱:buildAPKsApps,代碼行數:13,代碼來源:DataManager.java

示例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());
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:15,代碼來源:SimpleEntityNotNullDao.java

示例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();
        }
    }
}
 
開發者ID:amap-demo,項目名稱:weex-3d-map,代碼行數:38,代碼來源:DefaultWXStorage.java

示例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);
    }
}
 
開發者ID:ymqq,項目名稱:CommonFramework,代碼行數:16,代碼來源:BannerDao.java

示例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();
}
 
開發者ID:gabriel-silva,項目名稱:MapaDeIgarassuAdmin,代碼行數:12,代碼來源:DataBaseUtil.java

示例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);
    }
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:10,代碼來源:ToOneTarget2Dao.java

示例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);
    }
}
 
開發者ID:devzwy,項目名稱:NeiHanDuanZiTV,代碼行數:15,代碼來源:UserDao.java

示例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());
    }
}
 
開發者ID:ThirtyDegreesRay,項目名稱:OpenHub,代碼行數:31,代碼來源:BookMarkUserDao.java

示例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();
}
 
開發者ID:shevart,項目名稱:Android-SQLite-Master-Project,代碼行數:8,代碼來源:UserMessagesRelationDao.java

示例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();
}
 
開發者ID:sdrausty,項目名稱:buildAPKsApps,代碼行數:13,代碼來源:DataManager.java


注:本文中的android.database.sqlite.SQLiteStatement.bindLong方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。