【发布时间】:2018-02-04 04:44:15
【问题描述】:
我是 Neo4j 的新手,正在阅读这个示例:
try ( HelloWorldExample greeter = new HelloWorldExample( "bolt://localhost:7687", "neo4j", "test" ) )
{
greeter.printGreeting( "hello, world" );
}
在我的 Eclipse 中,这段代码运行良好。但是,我已经有一个可以通过
访问的 Neo4j 数据库http://localhost:7474/browser/
我的问题是在我上面的 Java 代码中,如何访问我现有的 Neo4j 数据库?如果我将“bolt://localhost:7687”更改为“http://localhost:7474”,我会收到此错误:
Exception in thread "main" org.neo4j.driver.v1.exceptions.ClientException: Unsupported URI scheme: http
at org.neo4j.driver.internal.DriverFactory.createDriver(DriverFactory.java:125)
at org.neo4j.driver.internal.DriverFactory.newInstance(DriverFactory.java:82)
at org.neo4j.driver.v1.GraphDatabase.driver(GraphDatabase.java:136)
at org.neo4j.driver.v1.GraphDatabase.driver(GraphDatabase.java:119)
at org.neo4j.driver.v1.GraphDatabase.driver(GraphDatabase.java:94)
at neo4j.Neo4j.<init>(Neo4j.java:19)
at neo4j.Neo4j.main(Neo4j.java:50)
那么我怎样才能通过'bolt'访问我现有的数据库(http://localhost:7474)?
【问题讨论】:
标签: neo4j