How can I know when I reach the last record in a table, since JDBC doesn't provide an EOF method?
You can solve this problem of different method of ResultSet class. It is present in java.sql.ResultSet package.
Answer1 :- With the help of last() method of ResultSet class you can reach end of the current result set. If your result set is scrollable.
Answer 2:- You can also use isLast() as you are reading ResultSet.
One thing to keep in mind, though, is that both methods tell you that you have reached the end of the current ResultSet, not necessarily the end of the table. SQL and RDBMSes make no guarantees about the order of rows, even from sequential SELECTs, unless you specifically use ORDER BY. Even then, that doesn't necessarily tell you the order of data in the table.