RE: P6Spy for logging SQL with value using iBatis in JDK 1.5
Shannon, Bryan <BShannon <at> Tribune.com>
2008-10-02 14:18:39 GMT
I have used P6Spy with iBatis quite successfully... Just follow along
with the documentation.
Also, try a great program I found out there called "Elvyx" that will
also let you record your sql statements (with and without placeholders).
These products both work by WRAPPING your existing jdbc driver (no
matter which it is) and recording metrics about the call before passing
the actual jdbc call to your own driver. I've had both of these wrap up
Sybase's jconnect, jTds, and mysql's jdbc drivers with no problem.
You configure each with what your actual jdbc url and options are, then
in your own java code, you set up your jdbc url to be the p6spy or elvyx
Elvyx is very helpful, as it stores your historical metrics in an
in-memory database (which you can query to get your own statistics) and
it has a nice front end that has a pie chart to show you up-front which
queries are taking the longest time to execute.
Either of these programs will do what you want, and either proxy driver
will most likely be able to be set up with Websphere's JNDI with no
problem. (p6spy uses a config file that might be tricky, it has to be
somewhere in Webshere's classpath) and Elvyx uses encoded parameters
sent to it's own jdbc url to determine how it should set up your own
(real) jdbc driver. I'd recommend either of these to any iBatis or even
Hibernate or straight jdbc users.
(Comes in especially handy when you're trying to get performance metrics
for certain queries, etc.)