Head's Up! Site migration is underway. Expect disruption to service on Thursday, Feb. 9!
β05-06-2020 02:19 AM
Hello,
I have a multiple graph like below
And i have a java application to communicate with the graph.
I want to know if i can specify the graph that i want to use or i have to use the default graph (because when i connect to the database with url: bolt://host:7687 i use the default graph).
Regards,
Mahdi.
Solved! Go to Solution.
β05-06-2020 05:16 AM
Changing the database is done via the SessionConfig.
https://neo4j.com/docs/driver-manual/current/cypher-workflow/#database-selection
try ( Session session = driver.session( SessionConfig.forDatabase( "examples" ) ) ) {
...
or
SessionConfig sessionConfig = SessionConfig.builder()
.withDatabase( "examples" )
.withDefaultAccessMode( AccessMode.READ )
.build();
try ( Session session = driver.session( sessionConfig ) ) {
...
β05-06-2020 05:16 AM
Changing the database is done via the SessionConfig.
https://neo4j.com/docs/driver-manual/current/cypher-workflow/#database-selection
try ( Session session = driver.session( SessionConfig.forDatabase( "examples" ) ) ) {
...
or
SessionConfig sessionConfig = SessionConfig.builder()
.withDatabase( "examples" )
.withDefaultAccessMode( AccessMode.READ )
.build();
try ( Session session = driver.session( sessionConfig ) ) {
...
β05-06-2020 06:06 AM
Thank you, it works with the SessionConfig.forDatabase()
All the sessions of the conference are now available online