title: java.sql.SQLException: ORA-00933: SQL command not properly ended when using getGeneratedKeys
body: <p>When I am using the following query it works.</p>
  
  <pre><code>query = "INSERT INTO MLRL1_PSR_MASTER (PROJECT_ID,FROM_DATE,TO_DATE,TEMPLATE_ID,TEMPLATE_TYPE,UPLOADED_BY,PSR_SLABID) " +
          " select '"+projectId+"' , FROM_DATE , TO_DATE,'"+templateId+"','"+tempType+"','"+user.getUserID()+"', "+slabId+
          " from MLRL1_PSR_SLABS where SLAB_ID="+slabId+" ";
  
  stmt = connection.prepareStatement(query, new String[] { "ID" });
  stmt.executeUpdate();
  stmt = connection.prepareStatement(query);
  </code></pre>
  
  <p>but if i use same query with getGeneratedKeys() like:</p>
  
  <pre><code>stmt = connection.prepareStatement(query, new String[] { "ID" });
  stmt.executeUpdate();
  ResultSet rs = stmt.getGeneratedKeys();
  
  while (rs.next()) {
      masterId = rs.getInt(1);
  }
  </code></pre>
  
  <p>I get an error</p>
  
  <blockquote>
    <p>ORA-00933: SQL command not properly ended </p>
  </blockquote>
  
  <p><code>stmt</code> is <code>java.sql.PreparedStatement</code>, Code compliance is 1.6 and JRE is 1.7.67 Oracle Driver is odbc6 and database is Oracle Database 11g Enterprise Edition Release 11.2.0.1.0</p>