Friday, July 31, 2009

How to get the result of a Select count(*) statement with Java ?

I want to get the number of rows returned (Select count * from [table] where employeeNo = ?). I just want the integer which will be returned, using java programming. I know how to do resultset etc if it is a regular sql statement but how should I capture just the count result?





Thanks

How to get the result of a Select count(*) statement with Java ?
Try "count(*)" instead of "count *". Then just getInt(1) from your ResultSet.

garden design

No comments:

Post a Comment