-2

ResultSet data_result = dao.getDetails();

Method resultset_method;

resultset_method = data_result.getClass().getMethod("getInt", Integer.class);

it is giving error:

java.lang.NoSuchMethodException: org.apache.commons.dbcp.DelegatingResultSet.getInt(java.lang.Integer)
MaheshPVM
  • 158
  • 1
  • 13

1 Answers1

0

The ResultSet's getInt method has two overloads, one that takes an int for the index and one that takes a String for a column name. You're attempting to retrieve a getInt() method, which indeed does not exist.

You need to supply the types that the method takes - eg, if you were going by name,

resultset_method = data_result.getClass().getMethod("getInt", String.class);
Evan Knowles
  • 7,426
  • 2
  • 37
  • 71