Sponsored Link •
|
Advertisement
|
Advertisement
|
This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.
Message:
JDBC 2.0 provides to methods to help with this. They are ResultSetObject.last() and ResultSetObject.getRow(). By going to the end of the result set and getting the row you will know how many records are in the resultset. for example: ResultSet resultSet = statement.executeQuery(sql); if (resultSet.last) { //if false, no rows in resultset In previous version of JDBC u have to do it the old fashion way i guess and count them yourself by iterating through the resultset and incrementing a count.
Replies: |
Sponsored Links
|