Code example for SQLiteStatement

Methods: bindDoublebindLongbindStringclearBindingsexecuteInsert

0
        countDescInEr = db.compileStatement(ExchangeRateDao.ER_COUNT_DESCRIPTION);
        countDescInErUnless = db.compileStatement(ExchangeRateDao.ER_COUNT_DESCRIPTION_UNLESS);
    } 
 
    public long create(ExchangeRate type) {
        insertStatementEr.clearBindings();
        insertStatementEr.bindString(1, type.getCurrencyFrom().getCurrencyCode());
        insertStatementEr.bindString(2, type.getCurrencyTo().getCurrencyCode());
        insertStatementEr.bindDouble(3, type.getExchangeRate());
        insertStatementEr.bindString(4, ConversionUtils.nullSafe(type.getDescription()));
        insertStatementEr.bindLong(5, type.getCreationDate().getTime());
        insertStatementEr.bindLong(6, type.getUpdateDate().getTime());
        insertStatementEr.bindLong(7, type.getImportOrigin().ordinal());
        return insertStatementEr.executeInsert();
    } 
 
    public long createPref(ExchangeRate type) {
        insertStatementErp.clearBindings();
        insertStatementErp.bindString(1, type.getCurrencyFrom().getCurrencyCode());
        insertStatementErp.bindString(2, type.getCurrencyTo().getCurrencyCode());
Stop searching for code, let great code find you!  Add Codota to your java IDE