Recently I implemented a performance monitoring driver (www.jamonapi.com) that needed to see what sql was associated with a PreparedStatement and I kept the info in a WeakHashMap to do that. WeakHashMap contents are garbage collected when they go out of scope. Very cool.
i.e. map.put(preparedStatement, sqlString);
Then you look up the sqlString by passing the preparedStatement back to the map when it is needed.