Don,

Yes, I had considered that, but most/all of the interesting data inside most PreparedStatment classes (DB2 & AS400 JDBC classes in particular) is non-public, so introspection wouldn't touch it unless you toyed with the SecurityManager stuff. The other problem is that most of these classes keep a TON of private data around to manage all the type conversion requirements and also to support the MetaData methods. I don't particularly want to log all that stuff on each query.

--- regards ---
Larry


At 10:01 AM 9/4/03 -0400, you wrote:
In the past I have used a generic bean-util style widget that uses reflection to introspect any passed Object, and dumps its contents into a formatted String....which is then in turn logged.

The DumpUtil (as I have implemented anyway) works well for reasonably simple/flat Objects, but does not have the smarts to generically traverse into Collections/arrays. If interested I can post/email.

-don


At 08:47 AM 9/4/2003 -0400, Shapira, Yoav wrote:



Howdy,
I personally am not a big fan of logging these types of objects: I much
prefer logging the beans I create from result sets (or DAO objects, or
whatever we call them this week).  However, one possibility for you
would be to create a ResultSetRenderer (implements
http://jakarta.apache.org/log4j/docs/api/org/apache/log4j/or/ObjectRende
rer.html)
or a PreparedStatementRenderer...

Yoav Shapira
Millennium ChemInformatics


>-----Original Message----- >From: Larry Young [mailto:[EMAIL PROTECTED] >Sent: Wednesday, September 03, 2003 8:30 PM >To: [EMAIL PROTECTED] >Subject: logging JDBC objects > >Hello, > > Has anyone looked at logging JDBC objects, like PreparedStatement >and ResultSet classes? They don't have any built-in ways of displaying >their contents, so I'm considering creating a wrapper class to do this for >me, but I thought I'd check the list to see if anyone else has already >solved this problem before I proceed. > >--- regards --- >Larry > > >-------------------------- >Larry Young >The Dalmatian Group >www.dalmatian.com > > > >--------------------------------------------------------------------- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you.



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]


_______________________________________

  Donald H. Larmee
  ALTERthought, Inc.
  804.301.8867 (c)

  www.alterthought.com
_______________________________________



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

--------------------------
Larry Young
The Dalmatian Group
www.dalmatian.com




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to