By "localhost" I'm assuming you mean the client host and not the server.
The SQL is happening on the server and that's where you'd want to log it.
You can log it in a million ways, but a common way is to use the log4j package.
You can create a logger for the class you want, and log the query as INFO.
google "log4j" and you find a myriad of resources, if you have any specific questions once you start using it, "Java in General (intermediate)" is likely an appropriate forum to ask [ May 19, 2008: Message edited by: Bill Shirley ]
Bill Shirley - bshirley - frazerbilt.com
if (Posts < 30) you.read( JavaRanchFAQ);
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com