我正在尝试使用Java应用程序中嵌入的Neo4j,并且正在使用以下代码:
this.items.push({...this.template})
但是我得到了这个例外:
package com.tp.neo4j.java.examples;
import org.neo4j.graphdb.GraphDatabaseService;
import org.neo4j.graphdb.Transaction;
import org.neo4j.graphdb.factory.GraphDatabaseFactory;
public class Neo4jJavaAPIDBOperation {
public static void main(String[] args) {
GraphDatabaseFactory dbFactory = new GraphDatabaseFactory();
GraphDatabaseService db = dbFactory.newEmbeddedDatabase("C:/TPNeo4jDB");
try (Transaction tx = db.beginTx()) {
// Perform DB operations
tx.success();
}
}
}
任何想法,请
答案 0 :(得分:2)
newEmbeddedDatabase
期望File
作为参数
GraphDatabaseService db = dbFactory.newEmbeddedDatabase(new File("C:/TPNeo4jDB"));