我正在尝试下面的 Java 代码,它的工作正常,但问题是我无法在 localhost:7474 控制台的 neo4j/database 中看到创建的节点。我已经重新启动服务器但仍然存在同样的问题,谁能帮忙。我也怀疑这些节点是在系统内存中创建的吗?
void createDb() throws IOException
{
graphDb = new GraphDatabaseFactory().newEmbeddedDatabase( "target/neo4j-hello-db" );
registerShutdownHook( graphDb );
BufferedReader CSVFile = null;
int i=0;
Transaction tx = graphDb.beginTx();
try
{
CSVFile = new BufferedReader(new FileReader("/home/sumit/Total_Keywords(0 - 3300000).csv"));
String dataRow = CSVFile.readLine();
while (dataRow != null){
i++;
if(i==200)
break;
String[] dataArray = dataRow.split(",");
for(String item:dataArray)
{
node = graphDb.createNode();
node.setProperty( "name", item );
System.out.println( node.getProperty( "name" ) );
tx.success();
}
dataRow = CSVFile.readLine();
}
}
finally
{
tx.finish();
CSVFile.close();
}
}