title: java getting SQL next sequence number of the record before insertion
body: <p>I have <code>TestingID</code> variable and a sql string as follows in my java code. the sql string will later be used for <code>prepareStatement</code>.  </p>
  
  <pre><code> int TestingID; 
  
   String sqlInsert = "INSERT INTO TESTING VALUES(TESTING_SEQ.NEXTVAL, ?, ?)";  
   ...  
  
   MethodA(TestingID);     //passing TestingID to MethodA
  </code></pre>
  
  <p>I need to get the next sequence value of the newly inserted record into the <code>TestingID</code> so that I can use it in another method as shown above.</p>