ResultSet query.

Discussion in 'Plugin Development' started by iPhysX, Dec 15, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    iPhysX

    Ok so i'm fiddling around with SQL. Is there any reason that this would only return the first row in the table?
    There are 10 rows and all have a value.
    :) THANKS
    Code:java
    1. try {
    2. if (result != null && result.next()) {
    3. String altar = result.getString("altar");
    4.  
    5. altars+= altar+"-";
    6.  
    7. }
    8. } catch (SQLException e) {
    9. e.printStackTrace();
    10. }
     
  2. Offline

    Chiller

    Try putting it in a for loop.
     
    DrAgonmoray likes this.
  3. Offline

    iPhysX

    I hate myself for this.
    Thanks.
     
  4. Offline

    Chiller

    Haha anytime!
     
  5. Offline

    iPhysX

    I ended up using

    Code:java
    1. while (result.next()) {}
     
Thread Status:
Not open for further replies.

Share This Page