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

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

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

ResultSet.<init>介绍

[英]Default constructor
[中]默认构造函数

代码示例

代码示例来源:origin: stackoverflow.com

class App
{
   public <T extends Msg> ResultSet<T> getResult(Class<T> cls)
   {
     return new ResultSet();
   }
}

代码示例来源:origin: stackoverflow.com

PreparedStatement ps = null;
  ResultSet rs = null;
  sql = "SELECT * FROM altemp1";
  try {
    ps = con.prepareStatement( sql );
    rs = new ResultSet(ps.executeQuery());
    while(rs.next()) {
      .....
    }
  }

代码示例来源:origin: io.vertx/vertx-mysql-postgresql-client-jasync

private ResultSet queryResultToResultSet(QueryResult qr) {
 com.github.jasync.sql.db.ResultSet rows = qr.getRows();
 if (rows == null) {
  return new ResultSet(Collections.emptyList(), Collections.emptyList(), null);
 } else {
  final List<String> names = rows.columnNames();
  final List<JsonArray> arrays = rowDataSeqToJsonArray(rows);
  return new ResultSet(names, arrays, null);
 }
}

代码示例来源:origin: vert-x3/vertx-mysql-postgresql-client

private ResultSet queryResultToResultSet(QueryResult qr) {
 com.github.jasync.sql.db.ResultSet rows = qr.getRows();
 if (rows == null) {
  return new ResultSet(Collections.emptyList(), Collections.emptyList(), null);
 } else {
  final List<String> names = rows.columnNames();
  final List<JsonArray> arrays = rowDataSeqToJsonArray(rows);
  return new ResultSet(names, arrays, null);
 }
}

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

public io.vertx.ext.sql.ResultSet asList(ResultSet rs) throws SQLException {
 List<String> columnNames = new ArrayList<>();
 ResultSetMetaData metaData = rs.getMetaData();
 int cols = metaData.getColumnCount();
 for (int i = 1; i <= cols; i++) {
  columnNames.add(metaData.getColumnLabel(i));
 }
 List<JsonArray> results = new ArrayList<>();
 while (rs.next()) {
  JsonArray result = new JsonArray();
  for (int i = 1; i <= cols; i++) {
   Object res = convertSqlValue(rs.getObject(i));
   if (res != null) {
    result.add(res);
   } else {
    result.addNull();
   }
  }
  results.add(result);
 }
 return new io.vertx.ext.sql.ResultSet(columnNames, results, null);
}

代码示例来源:origin: vert-x3/vertx-mysql-postgresql-client

private ResultSet queryResultToResultSet(QueryResult qr) {
 final Option<com.github.mauricio.async.db.ResultSet> rows = qr.rows();
 if (!rows.isDefined()) {
  return new ResultSet(Collections.emptyList(), Collections.emptyList(), null);
 } else {
  final List<String> names = ScalaUtils.toJavaList(rows.get().columnNames().toList());
  final List<JsonArray> arrays = rowDataSeqToJsonArray(rows.get());
  return new ResultSet(names, arrays, null);
 }
}

代码示例来源:origin: stackoverflow.com

return new ResultSet(); // depends on what you want to do on error

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

case "next":
 if (member.getValue() instanceof JsonObject) {
  obj.setNext(new io.vertx.ext.sql.ResultSet((JsonObject)member.getValue()));

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

@Before
public void before() {
 columnNames = Arrays.asList("foo", "bar", "wibble");
 results = new ArrayList<>();
 int numRows = 10;
 for (int i = 0; i < numRows; i++) {
  JsonArray result = new JsonArray();
  for (int j = 0; j < columnNames.size(); j++) {
   result.add("res" + j);
  }
  results.add(result);
 }
 rs = new ResultSet(columnNames, results, null);
}

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

@Test
 public void testJson() {

  JsonObject json = rs.toJson();
  ResultSet rs2 = new ResultSet(json);
  assertEquals(rs, rs2);

 }
}

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

if (outResult) {
 resultSet = new io.vertx.ext.sql.ResultSet(Collections.emptyList(), Collections.emptyList(), null).setOutput(convertOutputs(statement));

相关文章