Code example for SQLiteStatement

Methods: bindLong, bindString, execute

2
  { 
    final String ROUTE_TABLE_UPDATE = 
      "UPDATE route SET last_used = datetime() WHERE journey = ? and plan = ?"; 
     
    final SQLiteStatement update = db_.compileStatement(ROUTE_TABLE_UPDATE);
    update.bindLong(1, journey.itinerary());
    update.bindString(2, journey.plan());
    update.execute();
  } // updateRoute 
   
  public void renameRoute(final int localId, final String newName)
  { 
    final String ROUTE_TABLE_RENAME =
      "UPDATE route SET name = ? WHERE " + BaseColumns._ID + " = ?";
    final SQLiteStatement update = db_.compileStatement(ROUTE_TABLE_RENAME);
    update.bindString(1, newName);
    update.bindLong(2, localId);
    update.execute();    
  } // renameRoute 
   
  public void deleteRoute(final int localId)