• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to do a ResultSet row count?  RSS feed

 
Jacky Luk
Ranch Hand
Posts: 634
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
does this allow the where clause to happen?
select count(*)

And if I do

The ResultSet needs to be rewinded, how do I do that?
Thanks in advance
Jack
 
K. Tsang
Bartender
Posts: 3639
16
Firefox Browser Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you tried out your own code (using the result set's cursor)? Does it give you the expected result?

Yet for large result sets, using the sql count(*) is probably a more effective approach because count(*) is done on the db while result set is done in your program.
 
Jacky Luk
Ranch Hand
Posts: 634
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi k tsang
i tried the select(count) one
but with the where clause
mariadb rejects
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!