More for personal interest than anything else but I’ve decided to re-write and open-source part of what I worked on for the last hack day.

I’ve called it JDBCSpy and it’s available over on Google Code.  It’s worth noting that there are a couple of other projects that also aim to accomplish more or less similar things, notably P6Spy and JAMon.  Unfortunately it doesn’t look like P6Spy has had any active development done on it in the past 3 or 4 years.  The last time I checked it also had a rather cryptic set of dependencies (that had to be downloaded separately and put on the compilation classpath) and an overly complicated build.  Essentially, JDBCSpy aims to provide similar functionality but in an easily packaged driver that exposes information via JMX.  There will also be a standalone viewer that can visualize the information as it’s being gathered.

Objective

JDBCSpy aims to provide a lightweight means to obtain statistics at the JDBC driver level.

Status

It currently provides minimal statistics around JDBC Statements and PreparedStatements but functionality is expected to improve over time.

JDBCSpy has been tested using PostgreSQL and hsqldb but should more or less work with any configurable JDBC data source.

Dependencies

There are no run-time dependencies. JDBCSpy has test-time dependencies on TestNG and hsqldb.

Future Plans

* Support for more Statement/PreparedStatement? methods (currently only tracks executeQuery())
* Provide a nice UI for statistics visualization (Currently in progress, a Queries per Second chart has now been committed)

All in all, pretty basic stuff but it’s given me an opportunity to play a bit more with Maven and learn more about JDBC internals.  It’s far from production right now but should provide useful foundation for future enhancements.

Note to self:  Maven makes life so much simplier.  There’s nothing better than:  mvn idea:idea


Leave a Comment




  • Pet Peeve: Don’t email my password to me in plain text You know the drill. Signup for some random service on the internet Receive a confirmation email with your account information or Forget a password for some random service ...

  • Eclipise Memory Analyzer (MAT) I must say the Eclipse Memory Analyzer looks pretty slick. There is some pretty good material over on the developers blog. Lastly, there was a talk on it ...

  • Open-source Web-based Code Review Tool: Rietveld Guido van Rossum, of Python fame, has recently released a Django-based application that enables web-based code reviews... Rietveld. It supports any language and currently can hook into Subversion repositories. You ...

  • An implementation of the JVM in Javascript? Caught this over on JavaPosse Google Groups. Essentially, some bright fellows over in Japan have developed a bytecode->javascript compiler. There's a demo floating around that took a Tetris ...

  • Facebook Chat? So it looks like the Facebook Chat service has finally started rolling out to my network (Facebook Chat has been mentioned previously). Not quite sure how ...