91超碰碰碰碰久久久久久综合_超碰av人澡人澡人澡人澡人掠_国产黄大片在线观看画质优化_txt小说免费全本

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

關于VO讀取記錄

發布時間:2020-08-09 22:20:43 來源:ITPUB博客 閱讀:141 作者:kawontony 欄目:關系型數據庫

關于VO讀取記錄

getRowCount()
Counts the total number of rows in this row set.

計算這個行集的行總數

This method retrieves all rows from the View Object by executing the View Object's query and then callingnext() until the last row is retrieved. Thus, since it iterates through the View Object one record at a time, this method may be slow.

該方法通過執行視圖對象的查詢從視圖對象中獲取所有行,然后調用next()直到最后一行被調用。于是,由于它通過視圖對象一次迭代一條記錄,因此該方法是比較慢的。

If you are working with a large number of rows, or if your application demands a fast response, usegetEstimatedRowCount to obtain a quicker count.

如果你操作一大堆行,或者你的應用需要一個快速的響應,使用getEstimatedRowCount獲得一個更快的數量。

The following sample code uses getRowCount() to set up separate iterators for even numbered and odd numbered rows:

下面的代碼使用getRowCount()為基數和偶數行創立獨立的迭代器。

 // Default iterator gets even-numbered rows.
 // Second iterator gets odd-numbered rows.
 long nRows = vo.getRowCount();
 String msg = "";
 for (int i = 0; i < nRows; i +=2) {

 // Get and set row index values relative to a range.
 // Index of first row = 0.
 vo.setCurrentRowAtRangeIndex(i);
 Row currRow = vo.getCurrentRow();
 msg = " Default iterator (even): " + vo.getRangeIndexOf(currRow);
 printRow(currRow, msg);

 secondIter.setCurrentRowAtRangeIndex(i + 1);
 currRow = secondIter.getCurrentRow();
 msg = " Second iterator (odd): " + vo.getRangeIndexOf(currRow);
 printRow(secondIter.getCurrentRow(), msg);
 }


getRowCountInRange()
Counts the rows actually in the range.

計算范圍內的實際行數

getRowCountInRange()int
Gets the size of the current
RowSet's range

獲得當前RowSet(記錄集)的范圍大小。

getFetchedRowCount()int
Counts the number of rows fetched from the JDBC result set.

計算從JDBC結果集抓取的行數。

This method delegates to the default RowSetIterator.

This method can be used to determine whether the View Object has read all the rows from the cursor. For example, getEstimatedRowCount returns an equivalent of count(*) on the View Object. ThegetFetchedRowCount() method returns the count of rows already fetched. If getFetchedRowCount() returns a value less than getEstimatedRowCount(), then the View Object has not read all rows from the cursor.

該方法被用于確定視圖對象是否從游標中讀取所有的行。例如,getEstimatedRowCount返回視圖對象上count(*)相等的量。getFetchedRowCount()方法只返回已經抓取的行數。如果getFetchedRowCount()返回的值小于getEstimatedRowCount(),那么視圖對象沒有從游標中讀到所有行。

getEstimatedRowCount

Makes an estimated count of the rows in this row set.

This method estimates the number of rows in the row count by calling getQueryHitCount (which performs a SELECT COUNT (*) FROM table). Internal logic in Business Components for Java keeps the EstimatedRowCount up-to-date as rows are inserted and removed. Thus, after the first call to this method, it can return the estimated count quickly.

For example:

// Get the rowcount again because of deleted or inserted row

rowCount = (int) iter.getRowSet().getEstimatedRowCount();


If you are working with a large number of rows, or if your application demands a fast response, use this method instead ofgetRowCount.

Note however, that this method might not be as accurate as getRowCount().

注意:但是,這個方法可能沒有getRowCount準確。

To test whether the View Object has read all the rows from the cursor, you can use getEstimatedRowCount() in conjunction with getFetchedRowCount(). For example, getEstimatedRowCount() returns an equivalent of count(*) on the View Object. The getFetchedRowCount method returns the count of rows already fetched. If getFetchedRowCount() returns a value less than getEstimatedRowCount(), then the View Object has not read all rows from the cursor.


getFetchSize()
Gets the row pre-fetch size.

獲得行的預先抓取大小

The framework will use this value to set the JDBC row pre-fetch size. Note that the row pre-fetch size has performance ramifications. A larger fetch size is more expensive in terms of memory usage than a smaller size. The default fetch size is 1 row.

框架將使用這個值去設定JDBC行預抓取大小。注意行預抓取大小影響性能。比較大的抓取大小就內存使用而言比小的抓取大小要更昂貴。 默認的抓取大小是一行。

If the value of setFetchMode(byte) is FETCH_ALL, then the value of setFetchSize is disregarded.

如果setFetchMode的值是FETCH_ALL,則setFetchSize將被忽略。

For each View Object, this method is customizable. Deciding what value to use could be made at runtime based on how many rows are expected for a particular View Object.

對于每個視圖對象,這種方法是可定制的。可以在運行時基于一個特定視圖對象預期的行數決定使用什么值進行設定。


getRangeSize()
Returns the range size of the iterator.

獲得迭代器的范圍大小。


測試代碼:

PerAllPeopleVOImpl employerInstance=(PerAllPeopleVOImpl) this.getPerAllPeopleVO1();
int fetchedRowCount=employerInstance.getFetchedRowCount();
int rowCount=employerInstance.getRowCount();
int rowCountInRange=employerInstance.getRowCountInRange();
long estimatedRowCount= employerInstance.getEstimatedRowCount();
int rangeSize=employerInstance.getRangeSize();
int fetchSize=employerInstance.getFetchSize();
int allRowLength=employerInstance.getAllRowsInRange().length;

int employerCount=0;
while(employerInstance.hasNext())
{
PerAllPeopleVORowImpl eachEmployer= (PerAllPeopleVORowImpl)employerInstance.next();
String empName= eachEmployer.getLastName();
employerCount++;
}


logInfo("fetchedRowCount is "+fetchedRowCount);
logInfo("rowCount is "+rowCount);
logInfo("rowCountInRange is "+rowCountInRange);
logInfo("estimatedRowCount is "+estimatedRowCount);
logInfo("rangeSize is "+rangeSize);
logInfo("fetchSize is "+fetchSize);
logInfo("employerCount is "+employerCount);
logInfo("allRowLength is "+allRowLength);


測試結果:


fetchedRowCount is 0

rowCount is 1001

rowCountInRange is 1

estimatedRowCount is 1001

rangeSize is 1

fetchSize is 1

employerCount is 0

allRowLength is 1


問題:

實際數據庫的記錄數是:5 9924,distinct掉重復的person_id后,記錄數是3 1113。

在頁面上會報出如下警告:警告 - 查詢已超出 1000 行。可能存在更多的行,請限制查詢。


不知道是否與此設置有關。



關于next()方法:


next()ROW
Gets the next row in the iterator.

在迭代器中獲得下一行

This method delegates to the default RowSetIterator. If this method is called on a row set that has not yet been executed, executeQuery() is implicitly called.

這個方法委托給默認的RowSetIterator。如果這個方法在行集還沒有被執行的時候被調用,將隱式調用executeQuery

If the current row designation is to change, ViewRowImpl.validate() is called to validate the current row.

如果當前行的指定被改變,ViewRowImpl.validate()被調用驗證當前行。

The row set has a "slot" before the first row, and one after the last row. When the row set is executed the iterator is positioned at the slot before the first row. If next() is invoked on a newly-executed row, the first row will be returned. If next() is called when the iterator is positioned on the last row of the row set, nullis returned and the iterator is positioned at the slot following the last row.

行集在第一行之前,和最后一行之后都有一個“空位”。當行集被執行時,迭代器定位在第一行之前的空位。如果next()在一個新執行的行上被調用,第一行將返回。

If the iterator is at the last row of the range when next() is called, RowSetListener.rangeScrolled()is called to send ScrollEvent to registered RowSetListeners.

當next()被調用時,如果迭代器在范圍的最后一行,RowSetListener.rangeScrolled()被調用發送ScrollEvent到注冊的RowSetListeners。

When successful, this method fires a NavigationEvent to registered RowSetListeners, by callingRowSetListener.navigated(). The row returned is designated as the current row.

當成功的時候,該方法通過調用RowSetListener.navigated()觸發NavigationEvent 。返回的行被標志為當前行。

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

湛江市| 西平县| 色达县| 遵义县| 香河县| 静乐县| 长子县| 桃园县| 八宿县| 宾阳县| 田阳县| 宿州市| 宝兴县| 大英县| 赞皇县| 九寨沟县| 卫辉市| 呼玛县| 白朗县| 德化县| 黔东| 金寨县| 十堰市| 云林县| 庆安县| 平和县| 安达市| 栾川县| 铅山县| 泰宁县| 定襄县| 吉林市| 山西省| 九龙城区| 镶黄旗| 务川| 潼南县| 桦川县| 渭源县| 应城市| 大荔县|