#下面的两条配置非常重要,设置为trace后,将可以看到打印出sql中 ? 占位符的实际内容  

 #this is the most important config for showing parames like ?  

log4j中加入下面两条配置:

log4j.logger.org.hibernate.SQL=trace  

 log4j.logger.org.hibernate.type=trace