Slava
Slava

Reputation: 11

How to intercept & replace SQL in jdbc driver?

I have a Java application that I can't change and SQL queries thet it sends to Oracle database leaves much to be desired (to say the least) in terms of performance.

Is there any way to modify SQL before it is sent to DB?

E.g. some jdbc-proxy that would allow to intercept and modify SQL? Similar question on the net is http://www.dbforums.com/microsoft-sql-server/1644179-source-code-jdbc.html and I've found example of such proxy here http://code.google.com/p/log4jdbc/

Is there any better way to intercept and rewrite SQL if I can't change the application itself?

Upvotes: 1

Views: 1884

Answers (1)

jett
jett

Reputation: 1007

I personally haven't tried this but P6spy (http://sourceforge.net/projects/p6spy/) appears to address your needs.

Upvotes: 1

Related Questions