Code example for SQLiteDatabase

Methods: compileStatement

0
  public void deleteRoute(final int localId)
  { 
    final String ROUTE_TABLE_DELETE = 
      "DELETE FROM route WHERE " + BaseColumns._ID + " = ?";
     
    final SQLiteStatement delete = db_.compileStatement(ROUTE_TABLE_DELETE);
    delete.bindLong(1, localId);
    delete.execute();
  } // deleteRoute 
   
  public List<RouteSummary> savedRoutes()
  { 
    final List<RouteSummary> routes = new ArrayList<RouteSummary>();
    final Cursor cursor = db_.query(DatabaseHelper.ROUTE_TABLE_NAME, 
        new String[] { BaseColumns._ID, "journey", "name", "plan", "distance" },
                        null,  
                        null,  
                        null,  
                        null,  
                        "last_used desc");        
    if(cursor.moveToFirst())