This is my first java class
try {
//Build the query
BasicDBObject query = new BasicDBObject();
query.put("building_Id", building_Id);
query.put("floor_Id", floor_Id);
DBObject removeIdProjection = new BasicDBObject("_id", 0);
//Provide the query as an argument to the find()
DBCursor cursor = col.find(query, removeIdProjection);
//Iterate the cursor
while (cursor.hasNext()) {
System.out.println(cursor.next());
}
return new Status("success", cursor.toString());
} catch(Exception e) {
e.printStackTrace();
}
return null;
}
Output for first java class is
{"building_Id" : "3" , "floor_Id" : "23" , "x" : "717.5984497070312" , "y" : "512.9695434570312"}
{"building_Id" : "3" , "floor_Id" : "23" , "x" : "717.5984497070312" , "y" : "514.87548828125"}
{"building_Id" : "3" , "floor_Id" : "23" , "x" : "717.5984497070312" , "y" : "515.8284912109375"}
{"building_Id" : "3" , "floor_Id" : "23" , "x" : "717.5984497070312" , "y" : "517.7344360351562"}
I need to return the above output to second class.
But i`m getting only below output in second java class.
fetch paths response : {"code":"success","message":"DBCursor{collection=DBCollection{database=DB{name='trackbitDB'}, name='objects_path'}, find=FindOptions{, batchSize=0, limit=0, modifiers=null, projection=null, maxTimeMS=0, skip=0, sort=null, cursorType=NonTailable, noCursorTimeout=false, oplogReplay=false, partial=false}, cursor=null}"}
Second java class
try {
// api path to list all paths based on floor and building //fetchpath
String uri = API_SERVER_PATH + "object/fetchpath?building_Id=" + building_Id + "&floor_Id=" + floor_Id;
String result = ApiRequestHandler.sendGet(uri);
System.out.println("fetch paths response : " + result);
return result;
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
I think i`m made mistakes while returning. Anybody help me to solve this issue.!
Thanks in advance.!