How do I get only the first row from a ResultSet? I know how to iterate through the entire set, but how do I get just the first row?
ResultSet
Instead of iterating over the result set, just check if there exists an entry an read it:
ResultSet r = ...; if(r.next()) { String s = r.getString(1); ... }