简体   繁体   English

在graphdb中执行密码查询

[英]Executing cypher query in graphdb

I am very new to graph db. 我对图数据库非常陌生。 I am trying to get a sample result based on the following program. 我试图基于以下程序获取示例结果。 but i don't know what's the error. 但我不知道这是什么错误。 It's obviously showing no error but it stops after executing 它显然没有显示错误,但是执行后会停止

engine created 引擎创建

I don't know what went wrong.Please help me to fix this .Is there any problem with the jars I included. 我不知道出了什么问题。请帮助我解决此问题。我随附的罐子有任何问题。 Can anyone specify which all I have to include just to make sure that I did the right thing. 任何人都可以指定我必须包括的所有内容,以确保我做对了。

    RestAPI api = new RestAPIFacade("http://localhost:7474/");
    System.out.println("API created");
    final RestCypherQueryEngine engine = new RestCypherQueryEngine(api);
    System.out.println("engine created");
QueryResult<Map<String,Object>> result = engine.query("start n=node({id}) return n", map("id",1));

    System.out.println("query created");
    System.out.println(result);


for (Map<String, Object> row : result) 
{
    @SuppressWarnings("unused")
    Object tagline = row.get("tagline");
    long id=((Number)row.get("id")).longValue();
    System.out.println("id is " + id);
    System.out.println(row.get("myRow"));
    }

The java-rest-bindings library is not a very good tool for talking to the Neo4j Server. java-rest-bindings库不是与Neo4j Server对话的很好工具。 You would be better served using the Neo4j JDBC driver, which supports the latest transactional features in the 2.x series. 使用Neo4j JDBC驱动程序将为您提供更好的服务,该驱动程序支持2.x系列中的最新事务功能。

You can find it here: 你可以在这里找到它:

https://github.com/neo4j-contrib/neo4j-jdbc https://github.com/neo4j-contrib/neo4j-jdbc

And it is used like the regular JDBC API, see the JDBC API docs for reference. 而且它的用法类似于常规的JDBC API,请参阅JDBC API文档以供参考。 You connect using a neo4j connection string, like so: 您使用neo4j连接字符串进行连接,如下所示:

Connection conn = DriverManager.getConnection("jdbc:neo4j://localhost:7474/");

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM