This tutorial shows a few templating examples for the sample WorldDB provided by the official MySQL docs. We’ll use a simple query with two named parameters:

SELECT Name, Population
FROM Country
WHERE Population > :min AND  Population < :max

If you want to follow along, download the WorldDB and insert it into a database. Then in the PocketQuery administration set up a connection to it as JDBC datasource and add our sample statement as a query:

Using this query, you’ll be able to display names and populations of countries. You can specify a population range you’re interested in when adding the PocketQuery macro to a page. Simply set the parameters 'min' and 'max' to your liking.

Continue with "The Default Template"