Query returns nothing from database

后端 未结 1 1822
广开言路
广开言路 2021-01-23 10:48

I\'m trying to get a car from my database using the value FK_adId. I\'ve tried calling the method with the FK_adId value 52, and I\'ve checked that a c

相关标签:
1条回答
  • 2021-01-23 11:12
            rs.next();
       if (rs.next()) {
    

    Call .next() once, not twice. You advance to the first row of the results, then you advance to the second. Since the query did not return two rows, you do not get the second row. You skipped the row you wanted.

    0 讨论(0)
提交回复
热议问题