-->
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.  [ 4 posts ] 
Author Message
 Post subject: Print/log parameter values for ? in HQL/SQL statements
PostPosted: Thu Jul 12, 2007 9:04 am 
Newbie

Joined: Sun Apr 22, 2007 10:33 pm
Posts: 11
Hi *,
I'm using
Hibernate version 3.2.0.ga
Hibernate Annotations 3.2.1.ga.
Oracle10g

In our application we use all sort of queries- Named HQL, normal HQL, SQL etc. Obviously in most HQL/SQLs we use parameters.

How to configure (hibernate config xml file) to print the SQL/HQL parameters in the logs?
I can display formatted (using <property name="hibernate.show_sql">true</property>) SQL and HQL queries with ? (question marks) for the parameters. HOW CAN I ALSO DISPLAY THE PARAMETER USED IN THE SQL?HQL IN QUESTION?

Any help is greatly appreciated.

~/Gurram

_________________
~/Gurram


Top
 Profile  
 
 Post subject: you should put in the log4j
PostPosted: Thu Jul 12, 2007 4:58 pm 
Regular
Regular

Joined: Wed May 02, 2007 2:42 pm
Posts: 101
log4j.logger.org.hibernate.SQL=debug
log4j.logger.org.hibernate.bind=debug


Top
 Profile  
 
 Post subject: Print/log parameter values for ? in HQL/SQL statements
PostPosted: Fri Jul 13, 2007 3:18 am 
Newbie

Joined: Sun Apr 22, 2007 10:33 pm
Posts: 11
Is there an "log4j.xml" equivalent for the following?

log4j.logger.org.hibernate.SQL=debug
log4j.logger.org.hibernate.bind=debug

~/Gurram

_________________
~/Gurram


Top
 Profile  
 
 Post subject: Re: Print/log parameter values for ? in HQL/SQL statements
PostPosted: Mon Sep 13, 2010 2:24 pm 
Newbie

Joined: Mon Sep 13, 2010 2:22 pm
Posts: 1
<logger name="org.hibernate.SQL">
<level value="DEBUG"/>
</logger>
<logger name="org.hibernate.bind">
<level value="DEBUG"/>
</logger>


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