?
Solved

How to log calls to a JDBC driver?

Posted on 2007-08-03
9
Medium Priority
?
248 Views
Last Modified: 2013-11-23
I apologize if this is a noob question, but I am just getting familiar with JDBC after having a lot of experience writing applications against ODBC.  

When using ODBC, there is a trace mechanism that will log all calls made to the ODBC driver and the results returned from the database - this is very handy when trying to debug application problems.  

I haven't found a similar way to log calls made to a JDBC driver - My brief internet search pointed me at a third party JDBC driver that would basically perform a pass through, logging all calls.  While this would probably work, it seems strange that this functionality wouldn't be built into JDBC by default - is there a way to do this without having to install a third party JDBC driver?
0
Comment
Question by:clajo04
8 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 19628482
SQL logging is usually done by the database you use itself
0
 

Author Comment

by:clajo04
ID: 19628516
CEHJ: Unfortunately, that's not going to be very helpful if the driver isn't properly configured or for calls that don't communicate with the database... is there no standard way to do client side logging for JDBC?
0
 
LVL 92

Expert Comment

by:objects
ID: 19628918
No, there is no way.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 92

Accepted Solution

by:
objects earned 672 total points
ID: 19628923
A particular driver *may* provide something (as is the case with the odbc-jdbc bridge) but it is driver independant, theres no standard way available with all drivers.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 19630602
>>CEHJ: Unfortunately, that's not going to be very helpful if the driver isn't properly configured

Not sure what you mean by that

>>or for calls that don't communicate with the database

Which would they be? I thought you were interested in JDBC?

>>... is there no standard way to do client side logging for JDBC?
0
 
LVL 86

Assisted Solution

by:CEHJ
CEHJ earned 664 total points
ID: 19630605
Sorry

>>... is there no standard way to do client side logging for JDBC?

No there isn't
0
 
LVL 2

Assisted Solution

by:freeexpert
freeexpert earned 664 total points
ID: 19636525
For a pass through, I have found P6SPY adequately useful in past.
0
 
LVL 1

Expert Comment

by:Computer101
ID: 20213328
Forced accept.

Computer101
EE Admin
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
The viewer will learn how to implement Singleton Design Pattern in Java.
Suggested Courses
Course of the Month8 days, 19 hours left to enroll

621 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question