I've seen a lot of similar questions which try to achieve this by using a while loop to count the entries. But I was hoping that there would be a way similar to this which could work? String SQL = "SELECT Name FROM (table name) TABLE WHERE SCHEMA
PreparedStatement statement = conn.prepareStatement(SQL);
ResultSet a = statement.executeQuery();
System.out.println(a);