-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Using log4j with Hibernate
PostPosted: Mon Mar 12, 2007 8:50 am 
Newbie

Joined: Thu Aug 10, 2006 7:43 am
Posts: 14
Hello.
I am using Hiberante 3.1.3, Spring 1.2.8 and log4j. Is there a way to tell Hibernate (or spring... or log4j.. don't know where's the best place to ask for) to get a logging output which consists of the sent SQL query with INCLUDING the values? When I say
showSql in the spring appliation context I get the SQL query used with/via Hibernate but I can see only '?' for each used parameter. So how can I get an output which includes these values?

Thank you.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 12, 2007 10:00 am 
Expert
Expert

Joined: Fri Aug 19, 2005 2:11 pm
Posts: 628
Location: Cincinnati
I don't know if log4j or hibernate will do it, I forget. But, you can view them using p6spy.

_________________
Chris

If you were at work doing this voluntarily, imagine what you'd want to see to answer a question.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 12, 2007 10:54 am 
Expert
Expert

Joined: Tue Jul 11, 2006 10:21 am
Posts: 457
Location: Columbus, Ohio
Either use a jdbc spy (as suggested), or turn debug level on for the org.hibernate.type package. This will show you the binds for the statement parameters. Unfortunately, if you do it using log4j, you will also get the debug messages for the hydration phase of the load.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.