Connecting Java Clients and Peers

A Java application can use the JDBC thin client driver to connect to a GemFire XD cluster and execute SQL statements. Or, a Java application can use the JDBC peer client driver to boot a GemFire XD peer process and participate as a member of the cluster.

Both drivers use the basic JDBC connection URL of jdbc:gemfirexd: where:
  • jdbc: is the protocol.

  • gemfirexd: is the subprotocol.

Peer clients are generally used when an application needs fast access to local data, or when the application node can benefit from acting as a transaction coordinator for distributed transactions. Because peer clients act as members of the distributed system, they must authenticate with other members (if authentication is enabled) in order to join the system, and they may optionally host data.

Thin clients provide a light weight JDBC connection to the distributed system. By default, a thin client connects to an existing GemFire XD data store member, which acts as the transaction coordinator for executing distributed transactions. This provides either one-hop or two-hop access for executing queries or DML statements, depending on where data is located in the system. For certain types of queries, you can enable single-hop access for thin-client connections to improve query performance. See Enabling Single-Hop Data Access.