1
votes

How can i connect to an external neo4j server via Spring boot . I referred the example at https://spring.io/guides/gs/accessing-data-neo4j/ . Changed the following

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

But it is not working . Also when i installed neo4j it seems be secured with username password . What is the right way to connect to neo4j from spring boot

1

1 Answers

2
votes

The issue was the credentials were not being passed.

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

    return new SpringRestGraphDatabase("http://localhost:7474/db/data/",**"neo4j","nithin"**);
}

This worked ! . Thanks