Tuesday, June 19, 2007

P6Spy to the rescue

If you ever find yourself trying to use a *reusable* component that is half assed documented, you could attack the problem in many ways.

1- Run unit tests (unit tests tell much more than shit amount of documentation)
2- Read javadoc
3- Inspect database /E-R diagram
4- Endless hours of debugs (assuming you have access to source code)
etc etc

For item 3/4, i highly recommend using P6Spy to log each sql statement. Hibernate/iBatis also has a way of logging sql statements issued. P6Spy proxies jdbc driver and hands over to real driver after logging it to file.

Today i found myself deciphering a DB2 SQLJ based component. JAD is also handy too.

No comments: