title: Printing the preparedStatement SQL after the bind for Oracle jdbc driver
body: <p>I have tried several examples , but none of them seem to work. Here is the code I tried last</p>
  
  <pre><code> import oracle.jdbc.driver.OracleDriver;
   PreparedStatement prs = null;
   ResultSet rrs = null;
  Class stmt1 = null;
  java.lang.reflect.Field mem = null;
  
    requestSQL = "Select FIPS_STATE_CD_TXT, FIPS_COUNTY_CD_TXT from MSTR_FIPS_COUNTY where STATE_ID = ? " + " and COUNTY_TXT = ?";
  
      prs.setString(1, vPropertyState);
      prs.setString(2, vPropertyCounty);
      System.out.println(prs.toString()); //JRN
               Class stmt1 = prs.getClass();  
            java.lang.reflect.Field mem = stmt1.getField("sql");  
            String value= (String)mem.get(prs);  
            rrs = prs.executeQuery();
  </code></pre>
  
  <p>I get an error on this at :</p>
  
  <pre><code>   Exception trying to make a TAF call
     java.lang.NoSuchFieldException: sql
      at java.lang.Class.getField(Class.java:1520)
  </code></pre>
  
  <p>I even tried using this example from JavaWorld, but my compiler doesn't seem to recognize DebugLevel and StatementFactory. Is there a special package I should download for this?
  <a href="http://www.javaworld.com/javaworld/jw-01-2002/jw-0125-overpower.html?page=3" rel="nofollow">http://www.javaworld.com/javaworld/jw-01-2002/jw-0125-overpower.html?page=3</a></p>
  
  <p>I am using Java 1.6 and Oracle 11g. I am also looking for a quick fix, rather than installing log4jdbc or p6sy</p>