本文整理了Java中io.vertx.ext.sql.ResultSet.getOutput
方法的一些代码示例,展示了ResultSet.getOutput
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ResultSet.getOutput
方法的具体详情如下:
包路径:io.vertx.ext.sql.ResultSet
类名称:ResultSet
方法名:getOutput
[英]Get the registered outputs
[中]获取注册输出
代码示例来源: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
@Test
public void testStoredProcedure4() {
client.callWithParams("{call times2(?)}", new JsonArray().add(2), new JsonArray().add("INTEGER"), onSuccess(resultSet -> {
assertNotNull(resultSet);
assertEquals(0, resultSet.getResults().size());
assertEquals(new Integer(4), resultSet.getOutput().getInteger(0));
testComplete();
}));
await();
}
代码示例来源:origin: io.vertx/vertx-jdbc-client
@Test
public void testStoredProcedure3() {
connection().callWithParams("{call times2(?)}", new JsonArray().add(2), new JsonArray().add("INTEGER"), onSuccess(resultSet -> {
assertNotNull(resultSet);
assertEquals(0, resultSet.getResults().size());
assertEquals(new Integer(4), resultSet.getOutput().getInteger(0));
testComplete();
}));
await();
}
代码示例来源:origin: io.vertx/vertx-jdbc-client
@Test
public void testStoredProcedure1() {
connection().callWithParams("{call customer_lastname(?, ?)}", new JsonArray().add("Paulo"), new JsonArray().addNull().add("VARCHAR"), onSuccess(resultSet -> {
assertNotNull(resultSet);
assertEquals(0, resultSet.getResults().size());
assertEquals("Lopes", resultSet.getOutput().getString(1));
testComplete();
}));
await();
}
代码示例来源:origin: io.vertx/vertx-jdbc-client
/**
* This test has been marked as ignored since it can only run on mysql and it might not be 100% correct.
* A procedure is not supposed to return data by definition however MySQL allows this mix...
*
* This requires the following proc to be installed on a MySQL server:
*
* create DATABASE test;
* use test;
*
* DROP PROCEDURE `proc_test`;
*
* DELIMITER $$
* CREATE PROCEDURE `proc_test`(IN firstname varchar(45), OUT lastname varchar(45))
* BEGIN
* select concat(firstname, '!!!') into lastname;
* select now(6);
* END$$
* DELIMITER ;
*/
@Test
@Ignore
public void testStoredProcedure1() {
connection().callWithParams("{call proc_test(?, ?)}", new JsonArray().add("zepinos"), new JsonArray().addNull().add("VARCHAR"), onSuccess(resultSet -> {
assertNotNull(resultSet);
assertEquals(1, resultSet.getResults().size());
assertEquals("zepinos!!!", resultSet.getOutput().getString(1));
testComplete();
}));
await();
}
内容来源于网络,如有侵权,请联系作者删除!