Hi, How can I display the Query with all the ? replaced with its original value in a PreparedStatement?
Thanks in advance..
steve souza
Ranch Hand
Joined: Jun 26, 2002
Posts: 852
posted
0
Surprisingly I don't think you can.
Recently I implemented a performance monitoring driver (www.jamonapi.com) that needed to see what sql was associated with a PreparedStatement and I kept the info in a WeakHashMap to do that. WeakHashMap contents are garbage collected when they go out of scope. Very cool.
i.e. map.put(preparedStatement, sqlString);
Then you look up the sqlString by passing the preparedStatement back to the map when it is needed.
"Jinto KL", I can see you have been at the JavaRanch for a while. But it looks like nobody mentioned that we do require members to have valid display names.
Display names must be two words: your first name, a space, then your last name. Fictitious names are not allowed. ("KL" is not a last name.)
Please edit your profile and correct your display name since accounts with incorrect display names will be deleted.
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.
subject: Displaying the Query Content of PreparedStatement