Querying Example

You can query your GemFire data using OQL. OQL is similar to SQL but it works with objects. With OQL querying, you can combine data from a number of regions and drill down into nested region objects, extracting only the data points you need. You can also use indexing to optimize your query performance.

Running the Example

This example creates an example region with data and then runs a handful of queries against it. The first query selects everything from the region so you can see all data the queries are run against.

Note: To run this example, you must have terminal sessions configured for the QuickStart examples, as described in Setting Up Your Environment.

In a single session, run the example:

$ java quickstart.Querying

Example Source Files

Program and cache configuration source files:

Table 1. Cache configuration files, located in $SamplesDirectory/quickstart/xml
Querying.xml Initializes a region with sample Portfolio data for querying.
Table 2. Java program files, located in $SamplesDirectory/quickstart/quickstart
Querying.java Demonstrates querying on a set of data in a region.
Portfolio.java A stock portfolio that consists of multiple Position objects that represent shares of a stock.
Related Topics

Related Javadocs