Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
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