Yes, it is possible to access multiple servers on multiple query for that
you need to create multiple connections, for each server.
Please refer the following example for your reference:
// Connect
Connection conServer1 =
DriverManager.getConnection("jdbc:neo4j://localhost:7474/");
Connection conServer2 =
DriverManager.getConnection("jdbc:neo4j://localhost:7575/");
// Querying
try{
Statement stmtServer1 = conServer1.createStatement()
ResultSet rsServer1 = stmtServer1.executeQuery("MATCH (n:User) RETURN n.name");
Statement stmtServer2 = conServer2.createStatement()
ResultSet rsServer2 = stmtServer2.executeQuery("MATCH (n:User) RETURN n.name");
while(rsServer1.next())
{
System.out.println(rsServer1.getString("n.name"));
}
while(rsServer2.next())
{
System.out.println(rsServer2.getString("n.name"));
}
}
-Sukaant Chaudhary
<http://in.linkedin.com/pub/sukaant-chaudhary/33/ba8/479>
On Mon, Mar 2, 2015 at 7:31 PM, vincent fraboulet <[email protected]>
wrote:
> Hello,
>
> I have a Spring Project with SDN 3.2.1.
>
> Actually, the projet is connected to only one database, on an external
> server.
>
> Is it possible to use 2 differents databases on 2 differents servers, and
> redirect A query on server 1, and B query on server 2 ?
>
> I've done somes searches but i don't find anything.
>
>
> Thanks!
> Regards,
>
> --
> You received this message because you are subscribed to the Google Groups
> "Neo4j" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>
--
You received this message because you are subscribed to the Google Groups
"Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.