Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to do a ResultSet row count?

 
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: 3585
16
Android Java
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic