Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

There is a method getColumnCount in the JDBC API. Is there a similar method to find the number of rows in a ResultSet?

0
Posted

There is a method getColumnCount in the JDBC API. Is there a similar method to find the number of rows in a ResultSet?

0

There is no way to find the number of rows in a ResultSet and even if such a method was present, the result would be inaccurate because the setFetchSize and setMaxRows methods would affect the number rows present in the ResultSet . Best way to get number of rows for a particular statement is executing another query, applying count function on the main query.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123