Here is a snippet of some JDBC code I wrote, I want to know what I have to put in the while block to iterate the result, I've seen examples of JDBC code but have no idea how you choose what to put in the while block and how it helps with the final result, can anyone explain this to me ?
ResultSet result = select.executeQuery("SELECT *, FROM Titles");
System.out.println("Got results: ");/
// what do I put here ?
Example Code :
Statement statement = connection.createStatement();
String sql = "select * from people";
ResultSet result = statement.executeQuery(sql);
String name = result.getString("name");
long age = result.getLong("age");