Reputation: 3171
I need to see the query being sent to Oracle from a Java program. In the PostgreSQL JDBC driver, toString() does the job, but the same does not apply to prepared statements from Oracle JDBC implementation. Any ideas how to achieve that?
Upvotes: 1
Views: 11329
Reputation: 403461
Check out Log4Jdbc. This sits between your JDBC driver and the application, logging all DB traffic that goes back and forth. It's driver-agnostic, so need for driver-specific logging code.
Extremely handy, and would be even handier if it supported DataSources, but sadly it doesn't.
Upvotes: 5
Reputation: 67722
I think the getOriginalSql()
method returns the String being sent to Oracle.
Upvotes: 1