Hi in the following code it only prints the first id and the first name from the table. How do yo get it to print out all of the results from the query and not only the first results? thanks
Statement stat = conn.createStatement();
stat.execute("CREATE TABLE Test (Id VARCHAR(20), Name VARCHAR(20))");
stat.execute("INSERT INTO Test VALUES ('1AA', 'John')");
stat.execute("INSERT INTO Test VALUES ('2AA', 'George')");
stat.execute("INSERT INTO Test VALUES ('3AA', 'Richard')");
ResultSet result = stat.executeQuery("SELECT * FROM Test");
result.next();
System.out.println(result.getString("Name"));
System.out.println(result.getString("Id"));
stat.execute("DROP TABLE Test");