-->
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.  [ 2 posts ] 
Author Message
 Post subject: show_sql not working
PostPosted: Mon Jan 31, 2005 2:55 pm 
Newbie

Joined: Mon Jan 31, 2005 2:50 pm
Posts: 5
Hi everyone,
i'm trying to debug a couple of statements and I've enabled SQL statement logging (I think) on hibernate.cfg.xml and tweaked the log4j.properties file to debug, but I can't seem to get any SQL output.
The content of the files are:
hibernate.cfg.xml
Code:

<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
        "-//Hibernate/Hibernate Configuration DTD//EN"
        "http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">
<hibernate-configuration>

        <session-factory>

                <property name="dialect">net.sf.hibernate.dialect.PostgreSQLDialect</property>
                <property name="connection.driver_class">org.postgresql.Driver</property>
                <property name="connection.username">user</property>
                <property name="connection.password">private</property>
                <property name="connection.url">jdbc:postgresql://localhost/mydb</property>
    <property name="show_sql">true</property>

                <mapping resource="demo/Doc.hbm.xml" />
                <mapping resource="demo/DocLin.hbm.xml" />

        </session-factory>
</hibernate-configuration>


-------------------
and log4j.properties:

Code:
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n

log4j.rootLogger=debug, stdout
log4j.logger.net.sf.hibernate=debug
log4j.logger.net.sf.hibernate.SQL=debug



Any ideas of why this doesn't work?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 31, 2005 3:14 pm 
Beginner
Beginner

Joined: Mon Nov 29, 2004 5:34 pm
Posts: 35
Hi,
Add property to your hibernate.cfg.xml file.

<property name="hibernate.show_sql">true</property>


Then you will be able to see the Sql statements.

Good Luck.


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