Does getInt() accept a
string? I know that it accepts a whole number value as the column index as stated here
https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getInt-int- so this would work
because we are passing the index of the value to getInt.
This does suggest that the ID column has an index of 1.
However the API documentation states:
API Docs wrote:The ResultSet interface provides getter methods (getBoolean, getLong, and so on) for retrieving column values from the current row.
Values can be retrieved using either the index number of the column or the name of the column. In general, using the column index will be more efficient.
Columns are numbered from 1. For maximum portability, result set columns within each row should be read in left-to-right order, and each column should be read only once.
Perhaps you need to first use findColumn to get the index of the column as noted here
https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#findColumn-java.lang.String-.
Then use getInt() with the index found using findColumn().
What is the error message/exception message that you are getting aside from "Error"?