Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / January 2006

Tip: Looking for answers? Try searching our database.

Log SQL-Statements generatet by Tomcat

Thread view: 
antonberg1@gmx.de - 24 Jan 2006 10:59 GMT
Hi,

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.

I read about P6Spy, but there is no installation guide for Tomcat 4.1.

Please help me!
Anton
Juha Laiho - 24 Jan 2006 16:15 GMT
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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.