Hi Nandini, From your post I get the strong impression you suppose getFetchSize() will return the number of rows actually retrieved. This is not the case. In fact, there is no easy way in JDBC to determine that number. Your second solution is the 'good' one. Oh, by the way, you might want to read the documentation on JDBC. There is plenty that will tell you what the methods actually do. Good riding, Rudy.
I'm not sure whether my explanation is accurate, but I think a fetchSize is a kind of BufferSize; the number of rows which can be passed by the database at once. You may set it explicitly with 'setFetchSize ()' and it may be smaller or greater than the count of rows returned. [ April 06, 2004: Message edited by: Stefan Wagner ]