弹簧靴-独立式Neo4j

弹簧靴-独立式Neo4j,neo4j,spring-boot,spring-data-neo4j,Neo4j,Spring Boot,Spring Data Neo4j,如何通过Spring boot连接到外部neo4j服务器。我在会议上提到了这个例子。更改了以下内容 @Bean GraphDatabaseService graphDatabaseService() { SpringRestGraphDatabase x = null; return new SpringRestGraphDatabase("http://localhost:7474/db/data/"); } 但它不起作用。另外,当我安装neo4j时,它似乎是由用户名密码保

如何通过Spring boot连接到外部neo4j服务器。我在会议上提到了这个例子。更改了以下内容

@Bean
GraphDatabaseService graphDatabaseService() {
    SpringRestGraphDatabase x = null;
    return new SpringRestGraphDatabase("http://localhost:7474/db/data/");
} 

但它不起作用。另外,当我安装neo4j时,它似乎是由用户名密码保护的。从spring boot连接到neo4j的正确方法是什么?问题是没有传递凭据

@Bean
GraphDatabaseService graphDatabaseService() {
    SpringRestGraphDatabase x = null;

    return new SpringRestGraphDatabase("http://localhost:7474/db/data/",**"neo4j","nithin"**);
}
这奏效了。谢谢