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

x33g5p2x  于2022-01-30 转载在 其他  
字(4.2k)|赞(0)|评价(0)|浏览(162)

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

SQLConnection.batchCallableWithParams介绍

[英]Batch a callable statement with all entries from the args list. Each entry is a batch. The size of the lists inArgs and outArgs MUST be the equal. The operation completes with the execution of the batch where the async result contains a array of Integers.
[中]使用args列表中的所有条目批处理可调用语句。每个条目都是一个批次。InArg和OutArg列表的大小必须相等。在异步结果包含整数数组的批处理执行后,操作完成。

代码示例

代码示例来源:origin: io.vertx/vertx-rx-java

/**
 * Batch a callable statement with all entries from the args list. Each entry is a batch.
 * The size of the lists inArgs and outArgs MUST be the equal.
 * The operation completes with the execution of the batch where the async result contains a array of Integers.
 * @param sqlStatement sql statement
 * @param inArgs the callable statement input arguments
 * @param outArgs the callable statement output arguments
 * @param handler the result handler
 * @return 
 */
public io.vertx.rxjava.ext.sql.SQLConnection batchCallableWithParams(String sqlStatement, List<JsonArray> inArgs, List<JsonArray> outArgs, Handler<AsyncResult<List<Integer>>> handler) { 
 delegate.batchCallableWithParams(sqlStatement, inArgs, outArgs, handler);
 return this;
}

代码示例来源:origin: vert-x3/vertx-rx

/**
 * Batch a callable statement with all entries from the args list. Each entry is a batch.
 * The size of the lists inArgs and outArgs MUST be the equal.
 * The operation completes with the execution of the batch where the async result contains a array of Integers.
 * @param sqlStatement sql statement
 * @param inArgs the callable statement input arguments
 * @param outArgs the callable statement output arguments
 * @param handler the result handler
 * @return 
 */
public io.vertx.rxjava.ext.sql.SQLConnection batchCallableWithParams(String sqlStatement, List<JsonArray> inArgs, List<JsonArray> outArgs, Handler<AsyncResult<List<Integer>>> handler) { 
 delegate.batchCallableWithParams(sqlStatement, inArgs, outArgs, handler);
 return this;
}

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

@Override
public SQLConnection batchCallableWithParams(String sqlStatement, List<JsonArray> inArgs, List<JsonArray> outArgs, Handler<AsyncResult<List<Integer>>> handler) {
 delegate.batchCallableWithParams(sqlStatement, inArgs, outArgs, handler);
 return this;
}

代码示例来源:origin: io.vertx/vertx-lang-groovy

public static io.vertx.ext.sql.SQLConnection batchCallableWithParams(io.vertx.ext.sql.SQLConnection j_receiver, java.lang.String sqlStatement, java.util.List<java.util.List<Object>> inArgs, java.util.List<java.util.List<Object>> outArgs, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.List<java.lang.Integer>>> handler) {
  io.vertx.core.impl.ConversionHelper.fromObject(j_receiver.batchCallableWithParams(sqlStatement,
   inArgs != null ? inArgs.stream().map(elt -> elt != null ? io.vertx.core.impl.ConversionHelper.toJsonArray(elt) : null).collect(java.util.stream.Collectors.toList()) : null,
   outArgs != null ? outArgs.stream().map(elt -> elt != null ? io.vertx.core.impl.ConversionHelper.toJsonArray(elt) : null).collect(java.util.stream.Collectors.toList()) : null,
   handler != null ? new io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.List<java.lang.Integer>>>() {
   public void handle(io.vertx.core.AsyncResult<java.util.List<java.lang.Integer>> ar) {
    handler.handle(ar.map(event -> event != null ? event.stream().map(elt -> elt).collect(java.util.stream.Collectors.toList()) : null));
   }
  } : null));
  return j_receiver;
 }
}

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

@Test
public void testBatchCallableStatement() {
 final SQLConnection conn = connection();
 conn.batch(Arrays.asList("CREATE ALIAS println FOR \"io.vertx.ext.jdbc.JDBCBatchTest.proc\""), onSuccess(batchResult -> {
  assertNotNull(batchResult);
  assertEquals(1, batchResult.size());
  conn.batchCallableWithParams("{ call println() }", Arrays.asList(new JsonArray(), new JsonArray(), new JsonArray()), Arrays.asList(new JsonArray(), new JsonArray(), new JsonArray()), onSuccess(batchResult2 -> {
   assertNotNull(batchResult2);
   assertEquals(3, batchResult2.size());
   testComplete();
  }));
 }));
 await();
}

相关文章