You need to iterate result set. Result set will iterate on rows. For each row, you will need to get the column values in some data structure.
Here is an example: I have a table employee with fields ID, Name and Age. I need to get details of all the rows :
***************************************
try{
Connection con = DriverManager.getConnection("url", "userName", "passWord");
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("SELECT * FROM EMPLOYEE");
ArrayList employeeDetail = null;
ArrayList employees = new ArrayList();
while(rs.next())
{
int id = rs.getInt("ID");
String name = rs.getString("NAME");
int age = rs.getInt("AGE");
employeeDetail = new ArrayList();
employeeDetail.add(new Integer(id));
employeeDetail.add(name);
employeeDetail.add(new Integer(add));
employees.add(employeeDetail);
}
}catch(SQLException sqe)
{
//Do something with exception
}
***********************************
Hope it will help you understand how to do it.