
com.alicloud.openservices.tablestore.model.sql.SQLUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of tablestore Show documentation
Show all versions of tablestore Show documentation
Aliyun Open Services SDK for Java Copyright (C) Alibaba Cloud Computing All rights reserved. 版权所有
(C)阿里云计算有限公司 http://www.aliyun.com
package com.alicloud.openservices.tablestore.model.sql;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.ArrayList;
import java.util.List;
/**
* SQL API 的 Utils 方法
**/
public class SQLUtils {
private static final Logger LOG = LoggerFactory.getLogger(SQLUtils.class);
/**
* 解析 Show Tables SQL 返回结果
* @param response Show Tables SQL 返回结果
* @return 表列表
*/
public static List parseShowTablesResponse(SQLQueryResponse response) {
if (response.getSQLStatementType() != SQLStatementType.SQL_SHOW_TABLE) {
throw new IllegalStateException("SQL statement is not `show tables`.");
}
SQLResultSet rs = response.getSQLResultSet();
List tables = new ArrayList();
while (rs.hasNext()) {
tables.add(rs.next().getString(0));
}
return tables;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy