本文整理了Java中io.vertx.ext.sql.SQLConnection.call()
方法的一些代码示例,展示了SQLConnection.call()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。SQLConnection.call()
方法的具体详情如下:
包路径:io.vertx.ext.sql.SQLConnection
类名称:SQLConnection
方法名:call
暂无
代码示例来源:origin: io.vertx/vertx-rx-java
/**
* Calls the given SQL <code>PROCEDURE</code> which returns the result from the procedure.
* @param sql the SQL to execute. For example <code>{call getEmpName}</code>.
* @param resultHandler the handler which is called once the operation completes. It will return a <code>ResultSet</code>.
* @return
*/
public io.vertx.rxjava.ext.sql.SQLConnection call(String sql, Handler<AsyncResult<ResultSet>> resultHandler) {
delegate.call(sql, resultHandler);
return this;
}
代码示例来源:origin: vert-x3/vertx-rx
/**
* Calls the given SQL <code>PROCEDURE</code> which returns the result from the procedure.
* @param sql the SQL to execute. For example <code>{call getEmpName}</code>.
* @param resultHandler the handler which is called once the operation completes. It will return a <code>ResultSet</code>.
* @return
*/
public io.vertx.rxjava.ext.sql.SQLConnection call(String sql, Handler<AsyncResult<ResultSet>> resultHandler) {
delegate.call(sql, resultHandler);
return this;
}
代码示例来源:origin: io.vertx/vertx-jdbc-client
@Override
public SQLConnection call(String sql, Handler<AsyncResult<ResultSet>> resultHandler) {
delegate.call(sql, resultHandler);
return this;
}
代码示例来源:origin: io.vertx/vertx-lang-groovy
public static io.vertx.ext.sql.SQLConnection call(io.vertx.ext.sql.SQLConnection j_receiver, java.lang.String sql, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.Map<String, Object>>> resultHandler) {
io.vertx.core.impl.ConversionHelper.fromObject(j_receiver.call(sql,
resultHandler != null ? new io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.ext.sql.ResultSet>>() {
public void handle(io.vertx.core.AsyncResult<io.vertx.ext.sql.ResultSet> ar) {
resultHandler.handle(ar.map(event -> event != null ? io.vertx.core.impl.ConversionHelper.fromJsonObject(event.toJson()) : null));
}
} : null));
return j_receiver;
}
public static io.vertx.ext.sql.SQLConnection callWithParams(io.vertx.ext.sql.SQLConnection j_receiver, java.lang.String sql, java.util.List<Object> params, java.util.List<Object> outputs, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.Map<String, Object>>> resultHandler) {
代码示例来源:origin: io.vertx/vertx-sql-common
/**
* Calls the given SQL <code>PROCEDURE</code> which returns the result from the procedure.
*
* @param sql the SQL to execute. For example <code>{call getEmpName}</code>.
* @param handler the handler which is called once the operation completes. It will return a {@code ResultSet}.
*
* @see java.sql.CallableStatement#execute(String)
*/
@Fluent
@Override
default SQLClient call(String sql, Handler<AsyncResult<ResultSet>> handler) {
getConnection(getConnection -> {
if (getConnection.failed()) {
handler.handle(Future.failedFuture(getConnection.cause()));
} else {
final SQLConnection conn = getConnection.result();
conn.call(sql, HandlerUtil.closeAndHandleResult(conn, handler));
}
});
return this;
}
代码示例来源:origin: io.vertx/vertx-jdbc-client
@Test
public void testQueryTimeout() {
String sql = "{call NAP(1) + NAP(1) + NAP(1) + NAP(1) + NAP(1)}";
final SQLConnection conn = connection();
conn.execute("CREATE FUNCTION NAP() returns INT PARAMETER STYLE JAVA reads sql data language JAVA EXTERNAL NAME 'io.vertx.ext.jdbc.Functions.nap'", onSuccess(res -> {
conn.setQueryTimeout(1).call(sql, onFailure(resultSet -> {
assertNotNull(resultSet);
// assertEquals(1, resultSet.getResults().size());
// // we expect a String since UUID will be converted with the fallback mode
// assertNotNull(resultSet.getResults().get(0).getString(0));
testComplete();
}));
}));
await();
}
代码示例来源: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();
}
内容来源于网络,如有侵权,请联系作者删除!