欧美一区二区三区老妇人-欧美做爰猛烈大尺度电-99久久夜色精品国产亚洲a-亚洲福利视频一区二区

關(guān)于VO讀取記錄

關(guān)于VO讀取記錄

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

為金堂縣等地區(qū)用戶提供了全套網(wǎng)頁(yè)設(shè)計(jì)制作服務(wù),及金堂縣網(wǎng)站建設(shè)行業(yè)解決方案。主營(yíng)業(yè)務(wù)為成都網(wǎng)站制作、網(wǎng)站建設(shè)、外貿(mào)網(wǎng)站建設(shè)、金堂縣網(wǎng)站設(shè)計(jì),以傳統(tǒng)方式定制建設(shè)網(wǎng)站,并提供域名空間備案等一條龍服務(wù),秉承以專業(yè)、用心的態(tài)度為用戶提供真誠(chéng)的服務(wù)。我們深信只要達(dá)到每一位用戶的要求,就會(huì)得到認(rèn)可,從而選擇與我們長(zhǎng)期合作。這樣,我們也可以走得更遠(yuǎn)!

計(jì)算這個(gè)行集的行總數(shù)

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.

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

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

如果你操作一大堆行,或者你的應(yīng)用需要一個(gè)快速的響應(yīng),使用getEstimatedRowCount獲得一個(gè)更快的數(shù)量。

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

下面的代碼使用getRowCount()為基數(shù)和偶數(shù)行創(chuàng)立獨(dú)立的迭代器。

 // 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.

計(jì)算范圍內(nèi)的實(shí)際行數(shù)

getRowCountInRange() :int
Gets the size of the currentRowSet's range

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

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

計(jì)算從JDBC結(jié)果集抓取的行數(shù)。

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.

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

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().

注意:但是,這個(gè)方法可能沒(méi)有g(shù)etRowCount準(zhǔn)確。

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.

獲得行的預(yù)先抓取大小

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.

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

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.

對(duì)于每個(gè)視圖對(duì)象,這種方法是可定制的??梢栽谶\(yùn)行時(shí)基于一個(gè)特定視圖對(duì)象預(yù)期的行數(shù)決定使用什么值進(jìn)行設(shè)定。


getRangeSize()
Returns the range size of the iterator.

獲得迭代器的范圍大小。


測(cè)試代碼:

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);


測(cè)試結(jié)果:


fetchedRowCount is 0

rowCount is 1001

rowCountInRange is 1

estimatedRowCount is 1001

rangeSize is 1

fetchSize is 1

employerCount is 0

allRowLength is 1


問(wèn)題:

實(shí)際數(shù)據(jù)庫(kù)的記錄數(shù)是:5 9924,distinct掉重復(fù)的person_id后,記錄數(shù)是3 1113。

在頁(yè)面上會(huì)報(bào)出如下警告:警告 - 查詢已超出 1000 行??赡艽嬖诟嗟男?,請(qǐng)限制查詢。


不知道是否與此設(shè)置有關(guān)。



關(guān)于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.

這個(gè)方法委托給默認(rèn)的RowSetIterator。如果這個(gè)方法在行集還沒(méi)有被執(zhí)行的時(shí)候被調(diào)用,將隱式調(diào)用executeQuery。

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

如果當(dāng)前行的指定被改變,ViewRowImpl.validate()被調(diào)用驗(yàn)證當(dāng)前行。

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.

行集在第一行之前,和最后一行之后都有一個(gè)“空位”。當(dāng)行集被執(zhí)行時(shí),迭代器定位在第一行之前的空位。如果next()在一個(gè)新執(zhí)行的行上被調(diào)用,第一行將返回。

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

當(dāng)next()被調(diào)用時(shí),如果迭代器在范圍的最后一行,RowSetListener.rangeScrolled()被調(diào)用發(fā)送ScrollEvent到注冊(cè)的RowSetListeners。

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

當(dāng)成功的時(shí)候,該方法通過(guò)調(diào)用RowSetListener.navigated()觸發(fā)NavigationEvent。返回的行被標(biāo)志為當(dāng)前行。

網(wǎng)站題目:關(guān)于VO讀取記錄
網(wǎng)頁(yè)地址:http://chinadenli.net/article38/jieisp.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供、ChatGPT、網(wǎng)站營(yíng)銷、標(biāo)簽優(yōu)化、網(wǎng)站改版、網(wǎng)站排名

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)

h5響應(yīng)式網(wǎng)站建設(shè)