如何从neo4j浏览器查看我的数据库? [英] How to view my database from the neo4j browser?
本文介绍了如何从neo4j浏览器查看我的数据库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我是neo4j的新人。我在Eclipse中创建了一个 java
项目,以创建一个 neo4j
数据库及其中的一些节点。我看到数据库目录在我的工作区文件夹中创建。
I am new to neo4j. I have created a java
project in Eclipse to create a neo4j
database and some nodes in it. I am seeing the database directory getting created in my workspace folder. But how do i view it on the neo4j browser?
这里是我使用的示例代码:
Here is the example code i used :
package com.neo4j.demo;
import org.neo4j.graphdb.GraphDatabaseService;
import org.neo4j.graphdb.Node;
import org.neo4j.graphdb.Relationship;
import org.neo4j.graphdb.Transaction;
import org.neo4j.graphdb.factory.GraphDatabaseFactory;
public class Neo4jDemoOperations {
public static void main(String args[]) {
GraphDatabaseFactory dbFactory = new GraphDatabaseFactory();
GraphDatabaseService db = dbFactory.newEmbeddedDatabase("./DemoDatabase");
try (Transaction tx = db.beginTx()) {
Node javaNode = db.createNode(Tutorials.JAVA);
javaNode.setProperty("TutorialID", "JAVA001");
javaNode.setProperty("Title", "Learn Java");
javaNode.setProperty("NoOfChapters", "25");
javaNode.setProperty("Status", "Completed");
Node scalaNode = db.createNode(Tutorials.SCALA);
scalaNode.setProperty("TutorialID", "SCALA001");
scalaNode.setProperty("Title", "Learn Scala");
scalaNode.setProperty("NoOfChapters", "20");
scalaNode.setProperty("Status", "Completed");
Relationship relationship = javaNode.createRelationshipTo(
scalaNode, TutorialRelationships.JVM_LANGIAGES);
relationship.setProperty("Id", "1234");
relationship.setProperty("OOPS", "YES");
relationship.setProperty("FP", "YES");
tx.success();
}
System.out.println("Done successfully");
}
}
教程
和 TutorialRelationships
是枚举。
b $ b
推荐答案
我更改了
org.neo4j.server.database.location=
在 conf
文件夹中创建c> neo4j-server.properties 。我在工作区
文件夹中选择了路径作为我的数据库的路径,它工作了!
in the file neo4j-server.properties
inside the conf
folder. I chose the path as the path to my database in the workspace
folder and it worked!
这篇关于如何从neo4j浏览器查看我的数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文