4.13.2 Connecting with Java
You can obtain a connection to a remote graph server (PGX) instance by simply passing the
base URL of the remote PGX instance to the getInstance()
method. By
doing this, your application automatically uses the PGX client libraries to connect to a
remotely-located graph server (PGX).
You can specify the base URL when you initialize the in-memory graph server (PGX) instance using Java. An example is as follows. A URL to an in-memory graph server (PGX) is provided to the getInMemAnalyst
API call.
import oracle.pgx.api.*; import oracle.pg.rdbms.api.*; ServerInstance instance = GraphServer.getInstance("https://<hostname>:<port>","<username>","<password>".toCharArray()); PgxSession session = instance.createSession("my-session");