title: java: Statement.RETURN_GENERATED_KEYS Err:S1000 Exp: Before start of result set
body: <p>I used to execute this query with no problems what so ever, but lately i've been having exceptions. </p>
  
  <p>(on a mysql server)</p>
  
  <pre><code>48442 [NioProcessor-1] ERROR c.x.xpofacebook.mysql.MysqlDb - SQLException: Before start of result set
  48443 [NioProcessor-1] ERROR c.x.xpofacebook.mysql.MysqlDb - SQLState: S1000
  48443 [NioProcessor-1] ERROR c.x.xpofacebook.mysql.MysqlDb - VendorError: 0
  48451 [NioProcessor-1] ERROR c.x.xpofacebook.mysql.MysqlDb - stack trace: java.sql.SQLException: Before start of result set
  </code></pre>
  
  <p>The code:</p>
  
  <pre><code>String createPlayerRow = "insert into highscore_challenge_player "
              + "(fb_user_id,played,best_score,highscore_challenge_id) values ((select fb_user.id from fb_user where uid=?),?,?,?)";
          stmt.close();
          stmt = conn.prepareStatement(createPlayerRow,Statement.RETURN_GENERATED_KEYS);
          stmt.setLong(1, uid);
          stmt.setInt(2, 0);
          stmt.setInt(3, 0);
          stmt.setInt(4, highscoreChallengeId);
          stmt.executeUpdate();
          rs = stmt.getGeneratedKeys();
          rowId = rs.getInt(1); &lt;--- ERROR IN THIS LINE    
  </code></pre>
  
  <p>any ideas ? !? </p>
  
  <p>thanks</p>