Hi Christopher,
thanks for the comment, it's really interesting!
And it looks like more wrapping than before christmas, but I have never
taken a close look on JDBC implementations (at least not this close).
So, i'd be interested in that *super-sexy *class wrapper generator of yours!
Also in any experience, pitfalls or sources for manuals if you might have
some ideas!
Thank you,
Gergely Paljak
2009/1/28 Christopher Schultz ch...@christopherschultz.net:
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Gergely,
Gergely Paljak wrote:
A want to realize a logging system for tomcat that is capable of:
- logging the incoming request for Servlets (easy)
- and logging the time when the Tomcat response is sent (easy as well)
As you say, these are relatively easy to accomplish.
- logging the outgoing SQL queries inside Tomcat while maintaining a
mapping
between the requested Servlet and the sent SQL queries
- logging the incoming SQL query results
I think your best bet is to implement your own DataSource that extends
Tomcat's built-in datasource (or some other one, if you like). Have your
DataSource return Connection objects that wrap the ones provided by
Tomcat's DataSource object.
Your Connection class should produce wrapped Statement classes that log
the statements as they are executed, and wrapped ResultSet objects that
do ... something else. Due to the specific JDBC spec requirements about
how results are read, you may have to settle for only reading those
values /actually read/ by the application, instead of the entire result
set.
I have implemented JDBC interface wrappers before, and they are
completely miserable to do (just sooo much plumbing code). I wrote a
super-sexy class wrapper generator if you're interested in doing
something like this.
- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkmAplsACgkQ9CaO5/Lv0PAySgCfZSTz2qkBq4yZD3HCuvAYDTBb
2ygAnR3SMz+fR0Ow1rBF+lJcfjm5YJEU
=wTg7
-END PGP SIGNATURE-
-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org