本文整理汇总了Java中java.sql.Statement.getMaxRows方法的典型用法代码示例。如果您正苦于以下问题:Java Statement.getMaxRows方法的具体用法?Java Statement.getMaxRows怎么用?Java Statement.getMaxRows使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.sql.Statement
的用法示例。
在下文中一共展示了Statement.getMaxRows方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: TsfileQueryResultSet
import java.sql.Statement; //导入方法依赖的package包/类
public TsfileQueryResultSet(Statement statement, List<String> columnName, TSIService.Iface client,
TS_SessionHandle sessionHandle, TSOperationHandle operationHandle, String sql,
String aggregations, List<String> columnTypeList)
throws SQLException {
this.statement = statement;
this.sql = sql;
this.columnInfoList = new ArrayList<>();
this.columnInfoMap = new HashMap<>();
this.client = client;
this.operationHandle = operationHandle;
this.columnInfoList.add(TIMESTAMP_STR);
this.columnInfoMap.put(TIMESTAMP_STR, 1);
int index = 2;
for (String name : columnName) {
columnInfoList.add(name);
if(!columnInfoMap.containsKey(name)){
columnInfoMap.put(name, index++);
}
}
this.maxRows = statement.getMaxRows();
this.fetchSize = statement.getFetchSize();
this.operationHandle = operationHandle;
this.operationType = aggregations;
this.columnTypeList = columnTypeList;
}
示例2: setMaxRowsToReturn
import java.sql.Statement; //导入方法依赖的package包/类
/**
* Set the maximum rows to return to the client side
*
* @param statement
* the statement to set
* @param databaseConfigurator
* the DatabaseConfigurator which contains the getMaxRowsToReturn()
* method
* @throws SQLException
*/
public static void setMaxRowsToReturn(Statement statement,
DatabaseConfigurator databaseConfigurator) throws SQLException, IOException {
int maxRowsToReturn = DatabaseConfiguratorCall
.getMaxRowsToReturn(databaseConfigurator);
if (maxRowsToReturn > 0) {
if (statement.getMaxRows() == 0
|| (statement.getMaxRows() > maxRowsToReturn)) {
statement.setFetchSize(0); // To avoid any possible conflict
statement.setMaxRows(maxRowsToReturn);
}
}
}