public boolean checkTableAgainstData(String tableName, String pattern)
      throws NamingException, SQLException {
    Context ctx = cache.getJNDIContext();
    DataSource ds = (DataSource) ctx.lookup("java:/SimpleDataSource");
    boolean found = false;
    String id_str = "";

    String sql = "select * from " + tableName;

    try (Connection conn = ds.getConnection();
        Statement sm = conn.createStatement();
        ResultSet rs = sm.executeQuery(sql)) {
      while (rs.next()) {
        System.out.println("id:" + rs.getString(1));
        System.out.println("name:" + rs.getString(2));
        id_str = rs.getString(1);
        if (id_str.equals(pattern)) {
          found = true;
          break;
        }
      }
    }

    return found;
  }
This method is used to search for pattern which is the PK in the timestamped table created by
createTable() in CacheUtils class.
geode-junit/src/main/java/org/apache/geode/internal/jta/JTAUtils.java