1.1

Table Of Contents
Single hop execution is attempted only for prepared statements, and not for simple statements.
Single hop execution is attempted only for SELECT, UPDATE and DELETE statements, but not for INSERT
statements.
SQLFire does not support single-hop access for queries that require data from multiple data stores to be merged
together. Typically, queries having aggregates like MAX, MIN, AVG, ORDER BY, and so forth are executed
as if single-hop were disabled. If an aggregate query can provide all results from a single data store, then
SQLFire provides single-hop access for the query.
Tables that have an expression resolver are not considered for single-hop access.
Start a SQLFire Peer with the Peer Client JDBC Driver
The peer client driver class is packaged in com.vmware.sqlre.jdbc.EmbeddedDriver. In addition to the basic
JDBC Connection URL, peer client driver connections require one or more boot and/or connection properties
to congure the embedded SQLFire peer process for member discovery and other features.
For example:
jdbc:sqlfire:;mcast-port=33666;host-data=false
The connection properties can be specied 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 Conguration Properties on page 315.
In this case, all peers, including peer clients and SQLFire 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 SQLFire JDBC thin-client driver also
provides single-hop access to data for lightweight client applications.)
Note: If you use peer clients in a SQLFire 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 on page 84 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 =
DriverManager.getConnection("jdbc:sqlfire:;locators=localhost[3340];mcast-port=0;host-data=false");
// Alternatively, use multicast on port 33666 for peer member discovery...
/*
Connection conn =
DriverManager.getConnection("jdbc:sqlfire:;mcast-port=33666;host-data=false");
*/
// do something with the connection
} catch (SQLException ex) {
// handle any errors
System.out.println("SQLException: " + ex.getMessage());
System.out.println("SQLState: " + ex.getSQLState());
vFabric SQLFire User's Guide116
Developing Applications with SQLFire