访问Neo4j时出错

时间:2014-04-24 06:21:55

标签: java neo4j

在执行java代码以在neo4j中创建节点时,我们遇到了这些错误,甚至我们也不推荐使用EmbeddedGraphDatabase。 任何人都可以解决这个问题吗?

代码:

import org.neo4j.graphdb.GraphDatabaseService;
import org.neo4j.graphdb.Transaction;
import org.neo4j.cypher.javacompat.ExecutionEngine;
import org.neo4j.kernel.*;

public class check{
private static String DB_PATH="/home/ctsf/Documents/neo4j/data/graph.db";

public static void main(String args[]){


    GraphDatabaseService graphdb=new EmbeddedGraphDatabase(DB_PATH, null, null,   null, null);
    ExecutionEngine engine=new ExecutionEngine(graphdb);
    try(Transaction tx=graphdb.beginTx()){
        System.out.println("Entered try block");
        String query= "create (check: see{name:'abc'}) return check.name";
        engine.execute(query);
        System.out.println("exiting....");
    }
    finally{
        graphdb.shutdown();
    }
}
}

我们在执行后得到的错误是:

 org.neo4j.kernel.InternalAbstractGraphDatabase.appendStoreDir(InternalAbstractGraphDatabase.java:294)

 org.neo4j.kernel.InternalAbstractGraphDatabase.<init>(InternalAbstractGraphDatabase.java:270)

 org.neo4j.kernel.EmbeddedGraphDatabase.<init>(EmbeddedGraphDatabase.java:65)

0 个答案:

没有答案