antonberg1@gmx.de said:
>is there any possibility to log all SQL-Statements executed by the
>Oracle JDBC-Driver from a Servlet running on Tomcat 4.1.29? Especially
>is it possible to log preparedStatements?
>
>Surely, there is a logging system in the software we have, but when
>using a preparedStatement, then a '?' is logged.
Ok. You'll need to additionally log the bind values used. And that's
what prepared stateemnts basically are -- you send the statement
template with a few placeholders for bind values to the statement -
then later on you thell the database to bind certain values to
the placeholders in a certain prepared statement, and fire off your
request.
If you want to log that, you'll more or less need to log some
"symbolic" name for your prepared statement, along with the
bind values used for a given query.
Depending on your Oracle JDBC driver version, the driver may have
a debug mode -- see the documentation for the driver (documentation
available on otn.oracle.com, for registered users).

Signature
Wolf a.k.a. Juha Laiho Espoo, Finland
(GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V
PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
"...cancel my subscription to the resurrection!" (Jim Morrison)
antonberg1@gmx.de - 24 Jan 2006 16:57 GMT
Hi,
what do you think of P6Spy? Will this help me with preparedStatements?
Thanks for your help!
Anton
javabuddha@gmail.com - 24 Jan 2006 23:12 GMT
P6Spy does many more things:
- It will help you with the prepared statements.
- It will log the parameters going into the database and the values
coming out.
- It track the time each statement takes and which JDBC connection it
belongs to.
There are also tools that parse the P6Spy log files and point out the
trouble spots
for your applications. There should be a lot of articles on the web on
how to
integrate P6Spy with Tomcat.
Goog luck,
Matt
> Hi,
>
> what do you think of P6Spy? Will this help me with preparedStatements?
>
> Thanks for your help!
> Anton