The moose likes JDBC and Relational Databases and the fly likes PreparedStatement Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "PreparedStatement" Watch "PreparedStatement" New topic


Chinmay Bajikar
Ranch Hand

Joined: Dec 08, 2001
Posts: 159
Hi all,
I have 2 q's
First is,
I have a application with a database layer.
the data base layer is responsible for firing all the db queries.
I need to implement query logging for it.
Does JDBC have any automatic query logging techniq,so that it logs all the queries fired in one txt file.
And the 2nd one is,
After a PreparedStataemtn is prepared(ie after all the params of PreparedStatement are filled with the setAPis)is there i can get the Query that is going to be fired in String format,
Can i have the same query string with actual values instead of '?'
Thanks in adv,

The strength of the Wolf is the pack & the strength of the pack is the wolf....Rudyard Kipling
Blake Minghelli
Ranch Hand

Joined: Sep 13, 2002
Posts: 331
You might want to check out this article

Blake Minghelli<br />SCWCD<br /> <br />"I'd put a quote here but I'm a non-conformist"
I agree. Here's the link:
subject: PreparedStatement
It's not a secret anymore!