-->
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: Intercept the bank query hibernate sends.
PostPosted: Mon Oct 31, 2005 11:13 am 
Newbie

Joined: Wed Oct 26, 2005 1:29 pm
Posts: 9
Location: brazil
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 2.1.7

The generated SQL (show_sql=true):

Hi forun friends,
I have a doubt, for example there is a way to intercept the bank query hibernate sends to the bank, like this :
"from TUtilizacao u where u.codServico = '5' " ( HQL )
"select u.* from TUtilizacao u where u.codServico ='5' " ( SQL sended )

String s = "select u.* from TUtilizacao u where u.codServico ='5' ";
only this.

Thanks JP.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 31, 2005 10:24 pm 
Beginner
Beginner

Joined: Thu Jan 22, 2004 8:22 pm
Posts: 48
I don't understand the question here. You don't beleive Hibernate is displaying the same SQL it actually sends to the database?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 01, 2005 11:45 am 
Newbie

Joined: Wed Oct 26, 2005 1:29 pm
Posts: 9
Location: brazil
thats true JustKeith my client just want to know the sql thats ariving at the bank .

Thanks JP


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 01, 2005 11:56 am 
Beginner
Beginner

Joined: Thu Jan 22, 2004 8:22 pm
Posts: 48
First off I can say that I've never encountered a case where what Hibernate displays with show_sql=true was not entirely accurate. If you'd like to prove this to your self though you'll need to look to your database or the JDBC driver.

Many database servers have trace features that would allow you to see the SQL delivered to them. This is probably the most authoratative source in my opinion as it shows what the database engine is seeing.

Many JDBC drivers also having logging options. This is often useful when the database is on a server somewhere and shared by many people. I've used this frequently with DB2.

I've never used it personally but there is a open source JDBC driver called P6Spy that is designed to wrap another JDBC driver for the specific purpose of logging all interaction between a application and a JDBC driver. I've never used it personally but have heard it mentioned favorably here on the boards before.


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.