io.vertx.ext.sql.ResultSet.getNext()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(2.3k)|赞(0)|评价(0)|浏览(127)

本文整理了Java中io.vertx.ext.sql.ResultSet.getNext方法的一些代码示例,展示了ResultSet.getNext的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ResultSet.getNext方法的具体详情如下:
包路径:io.vertx.ext.sql.ResultSet
类名称:ResultSet
方法名:getNext

ResultSet.getNext介绍

[英]Get the next result set
[中]获取下一个结果集

代码示例

代码示例来源:origin: io.vertx/vertx-sql-common

public static void toJson(ResultSet obj, java.util.Map<String, Object> json) {
  if (obj.getColumnNames() != null) {
   JsonArray array = new JsonArray();
   obj.getColumnNames().forEach(item -> array.add(item));
   json.put("columnNames", array);
  }
  if (obj.getNext() != null) {
   json.put("next", obj.getNext().toJson());
  }
  json.put("numColumns", obj.getNumColumns());
  json.put("numRows", obj.getNumRows());
  if (obj.getOutput() != null) {
   json.put("output", obj.getOutput());
  }
  if (obj.getResults() != null) {
   JsonArray array = new JsonArray();
   obj.getResults().forEach(item -> array.add(item));
   json.put("results", array);
  }
  if (obj.getRows() != null) {
   JsonArray array = new JsonArray();
   obj.getRows().forEach(item -> array.add(item));
   json.put("rows", array);
  }
 }
}

代码示例来源:origin: io.vertx/vertx-jdbc-client

@Override
public io.vertx.ext.sql.ResultSet execute(Connection conn) throws SQLException {
 try (PreparedStatement statement = conn.prepareStatement(sql)) {
  // apply statement options
  applyStatementOptions(statement);
  helper.fillStatement(statement, in);
  boolean retResult = statement.execute();
  io.vertx.ext.sql.ResultSet resultSet = null;
  if (retResult) {
   io.vertx.ext.sql.ResultSet ref = null;
   // normal return only
   while (retResult) {
    try (ResultSet rs = statement.getResultSet()) {
     // 1st rs
     if (ref == null) {
      resultSet = helper.asList(rs);
      ref = resultSet;
     } else {
      ref.setNext(helper.asList(rs));
      ref = ref.getNext();
     }
    }
    retResult = statement.getMoreResults();
   }
  }
  return resultSet;
 }
}

代码示例来源:origin: io.vertx/vertx-jdbc-client

} else {
 ref.setNext(helper.asList(rs));
 ref = ref.getNext();

代码示例来源:origin: io.vertx/vertx-jdbc-client

@Test
public void testMultiSelect() {
 String sql = "{ call MS() }";
 final SQLConnection conn = connection();
 conn.execute("CREATE PROCEDURE MS() PARAMETER STYLE JAVA LANGUAGE JAVA READS SQL DATA DYNAMIC RESULT SETS 2 EXTERNAL NAME 'io.vertx.ext.jdbc.Functions.multiSelect'", onSuccess(res -> {
  conn.call(sql, onSuccess(resultSet -> {
   assertNotNull(resultSet);
   assertNotNull(resultSet.getNext());
   testComplete();
  }));
 }));
 await();
}

相关文章