nebula-java 客户端传递参数总是报错

  • nebula 版本:
  • 部署方式:单机
  • 安装方式:源码编译
  • 是否上生产环境: N
  • 问题的具体描述
    基于 GraphClientExample.java 文件做的修改,
    希望通过java连接到数据库然后执行一条查询语句。
    但是不知道怎样才能传递字符串类型的参数,谢谢指教!
    下面是我的代码:
session = pool.getSession("root", "nebula", false);
            {
                String selectSchema = "use basketballplayer;";
                ResultSet resp = session.execute(selectSchema);
                if (!resp.isSucceeded()) {
                    log.error(String.format("Execute: `%s', failed: %s",
                            selectSchema, resp.getErrorMessage()));
                    System.exit(1);
                }
            }

            TimeUnit.SECONDS.sleep(3);
            {
                Map<String, Object> paramMap = new HashMap<String, Object>();
                paramMap.put("p1", "player100");
                paramMap.put("p2", "player101");

                String query = "FIND ALL PATH WITH PROP FROM \"$p1\" TO \"$p2\" OVER follow YIELD path AS p;";   // 这一行什么也查不到,看起来$p1/$p2没有被替换成player100/player101
                String query = "FIND ALL PATH WITH PROP FROM $p1 TO $p2 OVER follow YIELD path AS p;";   // 这一行会报错 ERROR [main] - Execute_1: `FIND ALL PATH WITH PROP FROM $p1 TO $p2 OVER follow YIELD path AS p;', failed: SyntaxError: Parameter is not supported in vid near `$p1'
                //String query = "FIND ALL PATH WITH PROP FROM \"player100\" TO \"player101\" OVER follow YIELD path AS p;";  // 这一行是可以正常工作的

                ResultSet resp = session.executeWithParameter(query, paramMap);

                //ResultSet resp = session.execute(query);
                if (!resp.isSucceeded()) {
                    log.error(String.format("Execute_1: `%s', failed: %s",
                            query, resp.getErrorMessage()));
                    System.exit(1);
                }
                printResult(resp);
            }

此话题已在最后回复的 30 天后被自动关闭。不再允许新回复。