Question: how to fetch value from result set?
Answer: Invoke the Connection. createStatement method to create a Statement object.
Invoke the Statement. ... 
In a loop, position the cursor using the next method, and retrieve data from each column of the current row of the ResultSet object using getXXX methods. ... 
Invoke the ResultSet. ... 
Invoke the Statement.