使用SQLCLient的for循环中的sql查询

时间:2018-08-24 10:16:30

标签: orientdb sqlclient

我正在尝试执行以下代码,以将从db中获得的结果添加到列表中,

`env.getCapabilities().forEach(action->{

                con.queryWithParams("select @rid from capabilities where id=?", new JsonArray().add(action.intValue()) , selectOutputParentid -> {
                    if (selectOutputParentid.succeeded()) {
                        capability.add(selectOutputParentid.result().getRows().get(0).getString("rid"));
                      // System.out.println("The output "+selectOutputParentid.result().getRows().get(0).getString("rid"));

                        }


                    else{
                        System.out.println(selectOutputParentid.cause());
                        routingContext.response().end("provided user not found");

                    }
                });
           });`

但是抛出: Success The size 2 [15:34:38,373][SEVERE][vert.x-eventloop-thread-0][ContextImpl] Unhandled exception java.lang.NullPointerException at com.thbs.esb.UserManagement.UserManagementApi.lambda$20(UserManagementApi.java:364)

0 个答案:

没有答案