![]() |
Sponsored Link •
|
Advertisement
|
Advertisement
|
This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.
Message:
I want to create logs of all sql statements being sent to a database. However, there is a major flaw in this plan when it comes to the parameter setting of a PreparedStatement. A long list of methods are provided to setting every possible data type and known object type. The simple data types are easy to 'stringify' and insert to my sql string......but what can I do about the various objects that may be used as parameters??? So we can see, if a using class (that I'm not going to write) wants to use PreparedStatement to carry out the operation then my job of logging their sql statement becomes very difficult when they want to set a Date object (for example) as one of the parameters in the sql string. How do I generate a (simple) log statment for that?!?!?! by what mechanism could I link a parameter in a simple textual log string to an Object?
---START--- 10/11/01 13:49:55 ---END--- now how could I go about linking the parameter for the Name field to an object (let's pretend some complex Java class is used as the data type for the Name field)???
any ideas greatly appreciated... JohnSenford@hotmail.com
Replies:
|
Sponsored Links
|