當前位置: 首頁>>代碼示例>>Java>>正文


Java Statement.getMaxRows方法代碼示例

本文整理匯總了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;
}
 
開發者ID:thulab,項目名稱:iotdb-jdbc,代碼行數:26,代碼來源:TsfileQueryResultSet.java

示例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);
    }
}
   }
 
開發者ID:kawansoft,項目名稱:aceql-http,代碼行數:25,代碼來源:ServerSqlUtil.java


注:本文中的java.sql.Statement.getMaxRows方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。