【问题标题】:How to Access OQL Query on a Gemfire 9.6 Region in java如何在 Java 中访问 Gemfire 9.6 区域上的 OQL 查询
【发布时间】:2019-04-15 16:20:11
【问题描述】:
I am using Gemfire pivotal for the first time and I need someone who can help me with below question. The Gemfire Pivotal 9.6 is installed on Unix server and I am able to connect to Unix with no issue. I am inside unix now, but I can't access Gemfire. 

Q. How to Access OQL Query on a Gemfire 9.6 Region in java.

这是我连接到 Unix 的方式。

private String host = "这里的主机名"; private String port = "这里的端口号"; 私人字符串用户=“用户ID”; 私人字符串密码=“密码” 私有字符串 SSH 命令 = "ssh ------" 私人字符串 commandBah = "bash"; 私有字符串命令gfish = "sh /data/gemfire9.6/pivotal-gemfire-9.6.0/bin/gfsh";

        This is the way I am trying to connect to Gemfire which is not working properly now.



// Gemfire Connection URL, username and password 
            private String connect To Gemfire = "connect --locator=--------";
            private String username = "credential";--
            private String command Pass = "password"
            private String comman Setvariable  = "set variable --name=APP_RESULT_VIEWER --value=EXTERNAL";

【问题讨论】:

    标签: unix gemfire oql


    【解决方案1】:

    要在 java 中访问一个区域,您需要创建一个 GemFire 客户端。这是一个基本的 java sn-p 创建 GemFire 客户端并执行查询:

    ClientCache cache = new ClientCacheFactory()
          .addPoolLocator(locator_host, 10334)
          .create()
    cache.getQueryService().newQuery("select count(*) from /region").execute()
    

    如需更完整的示例,您可以查看 geode 示例项目(GemFire 基于 Geode)。下面是一个从客户端查询的例子:https://github.com/apache/geode-examples/tree/master/indexes

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多