My favorites | Sign in
Project Home Downloads Wiki Issues Source
Project Information
Members
Links

JDBCSpy

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.

The code is a work in progress (and likely will continue to be for the foreseeable future). It's an interesting little side project that has actually shown some utility in a couple of situations.

Dependencies

There are no run-time dependencies. JDBCSpy (jdbcspy-core) has test-time dependencies on TestNG and hsqldb.

See the installation instructions for information on getting started.

Future Plans

  • Support for more Statement/PreparedStatement methods (currently only tracks executeQuery())
  • Provide a nice UI for statistics visualization (Currently in development)

Recent Commits

03/14/08

Significant refactors around the viewing components (there have been a few commits over the last few month that haven't been accurately recorded on the project page).

What:

  • Introduced a common interface between GUI panels and the QueryStatistics they're displaying.
  • Replaying a session from a JDBCSpy logfile should now work a little better.

01/03/08

The result of some work performed during my pre-Christmas hack day.

What:

  • Updated to Surefire 2.4 and TestNG 5.7

  • Two new JDBCSpyMBean interface methods: mark() and getSQLExecutionTime().
    • mark() allows you to explicitly have a message logged
    • getSQLExecutionTime() provides the number of milliseconds spent executing SQL since the last reset.
  • Introduced new module: jdbcspy-testutil
    • JDBCSpyListener provides framework hooks to track SQL execution during TestNG test cases.
    • Provided an example callback implementation that generates an HTML report with test statistics.
  • Updated UI panel to provide a mechanism to explicitly connect to a JDBCSpyMBean (host/port).
    • mplemented a table panel that will display statistics about recently executed SQL.
    • HACK QueriesPerSecondPanel now supports basic replay from a log file.

11/30/07

Quick implementation of a properties object. The properties object should (fairly) generically handle JDBCSpy properties that have either been specified as System properties or as members of a 'jdbcspy.properties' file.

See modules/jdbcspy-core/examples for jdbcspy.properties examples

What:

  • Added support for reading properties from a jdbcspy.properties file on the classpath
  • Changed JDBCSpyDriver.class to JDBCSpyDriver.wrappedDriver

11/12/07

Implemented automatic resets and file-based logging.

What:

  • Initial support for enabling / disabling statistics gathering.
  • JDBCSpy can now optionally write queries to a file.
  • New JDBCSpyDriver.logFile connection url parameter
  • QueriesPerSecondPanel now periodically clears itself.

Powered by Google Project Hosting