I am using getRow() method of ResultSet class like:

int rowCount = result.getRow();

but when i run the application, it gives me the exception that says: The 'getRow()' method is only allowed on scroll cursors.

Please, anyone, who knows why it happened, explain it with some possible solutions
Thanks!

The API doc on ResultSet says getRow() is optionally supported on forward-only result sets. Sounds like your JDBC driver opted to not support it.

Try creating your statement to be scrollable

Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);