-->
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.  [ 5 posts ] 
Author Message
 Post subject: Log a prepared statement
PostPosted: Mon Feb 13, 2006 10:57 am 
Newbie

Joined: Mon Feb 13, 2006 10:54 am
Posts: 2
Hi,
how to log a prepared statement along with the parameters in hibernate.
Is it possible atall?
Or is there any way to tell to hibernate to use normal statements rather than prepared statements, so that we can log them.
Thanks,
Vijay.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 13, 2006 11:12 am 
Regular
Regular

Joined: Wed Feb 02, 2005 6:33 am
Posts: 70
We've found that making the Hibernate categories org.hibernate.SQL and org.hibernate.type have DEBUG level output (with the remainder covered by an ERROR level on org.hibernate) in log4j allows us to see the parameters being bound and the SQL being executed.


Top
 Profile  
 
 Post subject: Re: Log a prepared statement
PostPosted: Mon Feb 13, 2006 11:47 am 
Regular
Regular

Joined: Fri Sep 09, 2005 11:35 am
Posts: 101
vkdasari wrote:
Hi,
how to log a prepared statement along with the parameters in hibernate.
Is it possible atall?
Or is there any way to tell to hibernate to use normal statements rather than prepared statements, so that we can log them.
Thanks,
Vijay.


You can use p6spy or implement your own with this article as reference http://www-128.ibm.com/developerworks/java/library/j-loggable.html


Top
 Profile  
 
 Post subject: Thank you guys.
PostPosted: Mon Feb 13, 2006 1:23 pm 
Newbie

Joined: Mon Feb 13, 2006 10:54 am
Posts: 2
Thank you guys.

_________________
Vijay


Top
 Profile  
 
 Post subject: Re: Thank you guys.
PostPosted: Mon Feb 13, 2006 2:16 pm 
Regular
Regular

Joined: Fri Sep 09, 2005 11:35 am
Posts: 101
vkdasari wrote:
Thank you guys.


Please rate if any of the posts were helpful.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.