-->
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.  [ 1 post ] 
Author Message
 Post subject: Why aren't bindings displaying in hibernate log?
PostPosted: Wed Oct 28, 2009 1:17 pm 
Newbie

Joined: Wed Oct 14, 2009 3:22 pm
Posts: 16
Hi,

I'm using Hibernate 3.4.0.GA. How do I get the bindings to display in my hibernate.log file? That is, I want to know what values are getting passed to the query. In my log, I can see the query ...

Code:
DEBUG [org.hibernate.SQL, 2009-10-28 11:15:27,525]: select this_.identity_id as identity1_0_0_, this_.dateofbirth as dateofbi2_0_0_, this_.document_type as document3_0_0_, this_.dln as dln0_0_, this_.gender as gender0_0_, this_.resident_street as resident6_0_0_, this_.resident_city as resident7_0_0_, this_.resident_state as resident8_0_0_, this_.resident_zip5 as resident9_0_0_, this_.identity_action as identity10_0_0_, this_.issue_date as issue11_0_0_, this_.mailing_street as mailing12_0_0_, this_.mailing_city as mailing13_0_0_, this_.mailing_state as mailing14_0_0_, this_.mailing_zip5 as mailing15_0_0_, this_.first_name as first16_0_0_, this_.last_name as last17_0_0_, this_.middle_name as middle18_0_0_, this_.name_suffix as name19_0_0_ from DRIVER_MATCHING.IDENTITY this_ where (UPPER(this_.resident_zip5) = UPPER(?) and UPPER(this_.resident_state) = UPPER(?) and (this_.resident_street=?)) and ((TO_CHAR(?, 'YYYY') - TO_CHAR(dateofbirth, 'YYYY') -  (CASE WHEN TO_CHAR(?, 'MMDD') < TO_CHAR(dateofbirth, 'MMDD')        THEN 1 ELSE 0 END)) <= ? and not this_.document_type like ? and not this_.document_type like ? and not this_.document_type=?)
DEBUG [org.hibernate.jdbc.AbstractBatcher, 2009-10-28 11:15:27,529]: about to open ResultSet (open ResultSets: 0, globally: 0)
DEBUG [org.hibernate.jdbc.AbstractBatcher, 2009-10-28 11:15:27,529]: about to close ResultSet (open ResultSets: 1, globally: 1)
DEBUG [org.hibernate.jdbc.AbstractBatcher, 2009-10-28 11:15:27,529]: about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
DEBUG [org.hibernate.engine.StatefulPersistenceContext, 2009-10-28 11:15:27,529]: initializing non-lazy collections
DEBUG [org.hibernate.jdbc.ConnectionManager, 2009-10-28 11:15:27,529]: aggressively releasing JDBC connection
DEBUG [org.hibernate.jdbc.ConnectionManager, 2009-10-28 11:15:27,529]: releasing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]


but not what values are getting bound to the "?"s. How do I get these to display? Below is what is in my log4j.properties file ...

Code:
log4j.rootLogger=INFO, ROOT
log4j.logger.org.hibernate=DEBUG, HIBERNATE
log4j.additivity.org.hibernate=false

log4j.appender.ROOT=org.apache.log4j.RollingFileAppender
log4j.appender.ROOT.File=/opt/var/logs/youthful-driver/root.log
log4j.appender.ROOT.maxFileSize=20MB
log4j.appender.ROOT.maxBackupIndex=3
log4j.appender.ROOT.layout=org.apache.log4j.PatternLayout
log4j.appender.ROOT.layout.ConversionPattern=%p [%c, %d]: %m%n

log4j.appender.HIBERNATE=org.apache.log4j.RollingFileAppender
log4j.appender.HIBERNATE.File=/opt/var/logs/youthful-driver/hibernate.log
log4j.appender.HIBERNATE.maxFileSize=20MB
log4j.appender.HIBERNATE.maxBackupIndex=3
log4j.appender.HIBERNATE.layout=org.apache.log4j.PatternLayout
log4j.appender.HIBERNATE.layout.ConversionPattern=%p [%c, %d]: %m%n



Thanks, - Dave


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

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.