Hi,
there are lots of accessor-methods for the ResultSet like getString(), getInt(), etc. They take the name of the column or the number as parameter.
I guess the following example should work though I haven't tested it:
int maxValue;
Connection con =...