I tried a few examples, but none of them seem to work. Here is the code I tried in the past
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();
I get an error message:
Exception trying to make a TAF call java.lang.NoSuchFieldException: sql at java.lang.Class.getField(Class.java:1520)
I even tried using this example from JavaWorld, but my compiler does not seem to recognize DebugLevel and StatementFactory. Is there a special package that I have to download for this? http://www.javaworld.com/javaworld/jw-01-2002/jw-0125-overpower.html?page=3
I am using Java 1.6 and Oracle 11g. I am also looking for a quick fix, not installing log4jdbc or p6sy
source share