cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Spring Boot connect to a particular DB in Causal Cluster Multi Tenant Neo4j 4.x

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 .

2 REPLIES 2

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