-->
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.  [ 3 posts ] 
Author Message
 Post subject: Hibernate Show SQL With Values
PostPosted: Thu Oct 26, 2006 12:32 pm 
Newbie

Joined: Mon Oct 16, 2006 12:03 pm
Posts: 2
I know that Hibernate will show me the SQL if I add

<property name="hibernate.show.sql" value="true"></property>

to the config file but it shows the statement without values (the prepared statement with the ? in place of the values being set).

Is there a way to get Hibernate to show what values it is using in the prepared statement? We are getting foreign key constraint errors and it is very difficult to debug. Is the problem that we didn't map the properties to the correct columns? Or could it be we are populating the beans incorrectly? Seeing the values would help a lot.

Thanks!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 26, 2006 1:27 pm 
Regular
Regular

Joined: Wed Jul 27, 2005 2:33 am
Posts: 118
Discussed recently here:

http://forum.hibernate.org/viewtopic.php?t=965749&highlight=


Top
 Profile  
 
 Post subject: Try log driver
PostPosted: Thu Oct 26, 2006 2:10 pm 
Newbie

Joined: Thu Oct 12, 2006 6:12 pm
Posts: 8
The other forum discussion is neat, but for a quick and simple solution, I just use logdriver. It's a JDBC driver which just wraps a real JDBC driver and logs all statements before executing them.

http://rkbloom.net/logdriver/

I use it all the time in testing. I don't know if I'd ship with it though.

Good luck,
Stephen

ps. don't forget to rate!


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