title: java example of running cypher queries in neo4j using rest
body: <p>trying to build a java client for accessing the neo4j data , I don't want to use embedded mode of Neo4j please somebody give me the example code for the same am trying to run following code</p>
  
  <pre><code>    import org.neo4j.rest.graphdb.RestAPI;
      import org.neo4j.rest.graphdb.RestAPIFacade;
      import org.neo4j.rest.graphdb.RestGraphDatabase;
      import org.neo4j.rest.graphdb.query.RestCypherQueryEngine;
      import org.neo4j.rest.graphdb.util.QueryResult;
      import static org.neo4j.helpers.collection.MapUtil.map;
      import java.util.Map;
  
  
      public class CypherQuery {
           public static void main(String[] args) {
               try{
            System.out.println("starting test");
           final RestAPI api = new RestAPIFacade("http://localhost:7474/db/data/");
           System.out.println("API created");
           final RestCypherQueryEngine engine = new RestCypherQueryEngine(api);
           System.out.println("engine created");
           final QueryResult&lt;Map&lt;String,Object&gt;&gt; result = engine.query("start n=node(2) return n, n.name as name;", map("id", 0));
  
           System.out.println("query created");
           for (Map&lt;String, Object&gt; row : result) {
              long id=((Number)row.get("id")).longValue();
              System.out.println("id is " + id);
           }
           }
           catch(Exception e)
           {
              e.printStackTrace(); 
  
           }
           }
         }
  </code></pre>
  
  <p>But it is not showing any error or exception and it is not producing any output.</p>