Every answer uses .next() or uses .beforeFirst() and then .next(). But why cannot this:
result.first();
So you need to just set the pointer to the first record and go from there. It's possible since Java 1.2 and I just wanted to mention this for anyone whose ResultSet exists of one specific record.
Want to be a SQL expert? Come and join this SQL training and certification program by Intellipaat.
Do check out the video below