Modify/Suppress SQL Statements?

41 views
Skip to first unread message

dbw...@yahoo.com

unread,
Oct 30, 2014, 11:36:24 AM10/30/14
to p6spy...@googlegroups.com
I need to wrap a jdbc driver and make it so that we can ignore autoCommit commands as the driver I'm using doesn't support it, and the app I use is sending those commands.

Can I do this with p6spy?  
I didn't see anything that mentions how to modify / suppress SQL commands.
But the Info page mentions: P6Spy is an open source framework for applications that intercept and optionally modify database statements.
So, I'm hoping someone can point me in the right direction.

Thanks!

Quinton McCombs

unread,
Oct 30, 2014, 1:15:48 PM10/30/14
to p6spy...@googlegroups.com
Currently, P6Spy does not have any functionality to block or modify commands sent to the database.  It is possible to do this with P6Spy but you will need to write some code to do it.  

At it's core, P6Spy is really just a framework to create dynamic proxies around various JDBC objects like the connection, statement, resultset, etc.  The modules in P6Spy (configured via the modulelist setting) are really just collections of pre-built interceptors.  They all start by adding a proxy around the connection which in turn creates proxies around the other objects.  For example, P6LogFactory adds the proxy that handles the logging of the various SQL statements and the results.

It should be fairly easy for you to create a new module which implements P6Factory to create the proxy that you need to block the auto commit.  This is assuming that you are talking about intercepting the Connection.setAutoCommit() and Connection.getAutoCommit() methods.   
Reply all
Reply to author
Forward
0 new messages