Code example for SQLiteStatement

Methods: bindLongclearBindingssimpleQueryForLong

0
        stmtDeleteByPaymentId.bindLong(1, paymentId);
        stmtDeleteByPaymentId.execute();
    } 
 
    public int countPaymentsInTrip(long tripId) {
        stmtCountPaymentsInTrip.clearBindings();
        stmtCountPaymentsInTrip.bindLong(1, tripId);
        return (int) stmtCountPaymentsInTrip.simpleQueryForLong();
    } 
 
    public List<PaymentReference> getAllPaymentsInTrip(long tripId) {
        List<PaymentReference> list = new ArrayList<PaymentReference>();
        Map<Long, PaymentReference> resultMap = new HashMap<Long, PaymentReference>();
        Cursor c =
                db.rawQuery(PAYMENT_QUERY,
                        new String[] { String.valueOf(tripId) });
        if (c.moveToFirst()) {
            do { 
                long paymentId = c.getLong(0);
                PaymentReference ref = resultMap.get(paymentId);
Contextual code suggestions in your IDE  Get Codota for Java