You can use the method getMetaData() to get an instance of ResultSetMetaData found in the class ResultSet. Using the instance of ResultSetMetaData, just call the method getColumnCount(). It returns an int value.
Regards,
Leon If you need additional help, you can email to me at zaoliang@hotmail.com I don't guaranty that I will be able to solve your problems but I will try my best
As far as I know there isn't. The getColumnCount() only tells you the number of columns in the resultSet, not the number of rows.
There are two ways to do it.
1. Keep your own counter while processing the records.
2. Add count(*) as field in your SQL statement.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.