This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC and the fly likes monitoring JDBC Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "monitoring JDBC" Watch "monitoring JDBC" New topic
Author

monitoring JDBC

christoph weingarten
Ranch Hand

Joined: Oct 10, 2002
Posts: 39
hi,
is there any way to monitor the JDBC-datastream between a db-server and a java-client?
i'm using jconnect5.5 to connect to a sybase-db.
does anybody know a good moitoring-tool?
regards
christoph
Loren Rosen
Ranch Hand

Joined: Feb 12, 2003
Posts: 156
Do you really want to look at the protocol between the JDBC driver and the server, or do really want to know what queries are being sent?
To log the queries, log4j has a logging facility, which has some limitations. Various people have tried to fix these, e.g. see here
and here
... a google search for 'jdbc log4j' might find even more.
There's also this article from IBM developer works.
If you're using some O/R mapping tool, or an app server, it may have facilities for doing the logging. Also, your database server can probably be set-up to log queries.
As for lower-level protocol logging, most JDBC drivers interact with the server in the same way as any other client. The tools to look at the interaction are specific to the DBMS.
Sean Sullivan
Ranch Hand

Joined: Sep 09, 2001
Posts: 427
Try http://www.p6spy.com/
Also, java.sql.DriverManager has a method called "setLogWriter"
christoph weingarten
Ranch Hand

Joined: Oct 10, 2002
Posts: 39
Thanks! I solved the problem with some simple System.out.println's...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: monitoring JDBC
 
Similar Threads
Re Connection pooling
jdbc
transfer data from one DB to another DB ?
Network Adaptor Could Not Establish Connection
tomcat on windows and database on linux