Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
01-14-2021 10:33 AM
How to connect to a particular DB in Causal Cluster Multi Tenant Neo4j 4.x using Spring Boot
Earlier we were able to connect to THE Neo4j DB in 3.5.x .
01-15-2021 01:14 AM
01-15-2021 08:56 AM
Hi Michael,
I have tried two options as below :
Option 1: Setting DB name while creating session from Driver-
try (Driver driver = driver()) {
try (Session session = driver.session(SessionConfig.builder().withDatabase("cup").withDefaultAccessMode(AccessMode.WRITE).build())) {
session.run("CREATE (a:Person{name:'Jeet Ram'}) RETURN a");
}
}
Option 2: Providing DB name along with other config in yml file as below-
spring:
data:
neo4j:
password: password@123
uri: neo4j+s://abc.com:7687
username: dev_cup
database: cup
But in both option, Neo4j driver is connecting to default database not to cup database(cup is custom database).
Please let us know if there is any sample code which will create custom database connection.
Thanks,
Jeet Ram
All the sessions of the conference are now available online