How to get only the first row from a ResultSet

后端 未结 4 399
南旧
南旧 2021-01-01 12:17

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?

4条回答
  •  灰色年华
    2021-01-01 13:17

    In my case the following approach works well:

    ResultSet RSet  = ...;
    RSet.next();
    Integer TestType = RSet.getInt("Type");
    

提交回复
热议问题