Go through the Scanner or InputStreamReader for reading values from the user.
Loop through the ResultSet and store values either in some data structure or a single variable.