java - ResultSet getFetchSize() doesn't seem to work? -


i'm having trouble getfetchsize() function.

i need know if sql query has returned 0 rows.

i've tried simple statement:

if (rs.getfetchsize()==0)     system.out.println("headline"); 

where rs of resultset type. above code doesn't seem work. prints message whether rs empty or not.

i checked sql query , correctly returned non-empty result when rows existed.

any thoughts on how can determine whether query has returned 0 rows? googled , couldn't find answer.

resultset.getfetchsize() doesn't return number of results! here:

standard jdbc enables specify number of rows fetched each database round-trip query, , number referred fetch size

you can iterate across result set , if don't have entries, can determine got no results. why can't result size ? because database returning pointer results , it's relying on iterate through (going server each row).


Comments

Popular posts from this blog

php - Zend Framework / Skeleton-Application / Composer install issue -

c# - Better 64-bit byte array hash -

python - PyCharm Type error Message -