Start a GemFire XD Peer with the Peer Client JDBC Driver

The peer client driver class is packaged in com.pivotal.gemfirexd.jdbc.EmbeddedDriver. In addition to the basic JDBC Connection URL, peer client driver connections require one or more boot and/or connection properties to configure the embedded GemFire XD peer process for member discovery and other features.

For example:

The connection properties can be specified either in the connection URL or passed in the Properties parameter to the DriverManager.getConnection method.

In the connection URL, you specify attributes as key=value pairs: [;attributes] preceded by and separated by semicolons. For more on these properties, see Configuration Properties.

In this case, all peers, including peer clients and GemFire XD servers, are part of the same distributed system, discovering each other using either locator(s) or multicast. SQL statements that you execute in the peer client have at most single-hop access to data in the distributed system. (The GemFire XD JDBC thin-client driver also provides single-hop access to data for lightweight client applications.)

Note: If you use peer clients in a GemFire XD distributed system that also contains data stores, keep in mind that peer clients themselves cannot use disk stores or persist data. You must start data stores and locators before starting peer clients, because peer clients rely on data stores to persist data. See Peer Client Considerations for Persistent Data for more information.
This code sample shows a more complete example of starting a peer client in a Java application:
try {
java.util.Properties p = new java.util.Properties();

// Use the locator running on the local host with port 3340 for peer member discovery...
Connection conn =

// Alternatively, use multicast on port 33666 for peer member discovery...
Connection conn =
// do something with the connection

} catch (SQLException ex) {
// handle any errors
System.out.println("SQLException: " + ex.getMessage());
System.out.println("SQLState: " + ex.getSQLState());
System.out.println("VendorError: " + ex.getErrorCode());