Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Databases / April 2005

Tip: Looking for answers? Try searching our database.

View the queries executed in MySQL

Thread view: 
LR - 15 Apr 2005 16:04 GMT
Hi,

I use Hibernate in my java project and I know the "show sql" option but it
doesnt display the entire query. How could I monitor my MySQL server to see
the queries executed ?

Thank you
Lilian
Robert - 15 Apr 2005 20:25 GMT
You can see the prepared statements right?  They were really helpful to
us at my work. What is the problem you're having?  I know you can write
your own debuggable Preparedstatement class if you're feeling really
ambitious.  You might even look for one on the net.  I remember reading
an article about someone writing their own so they could see the
populated query at runtime.
LR - 18 Apr 2005 10:40 GMT
> You can see the prepared statements right?  They were really helpful to
> us at my work. What is the problem you're having?  I know you can write
> your own debuggable Preparedstatement class if you're feeling really
> ambitious.  You might even look for one on the net.  I remember reading
> an article about someone writing their own so they could see the
> populated query at runtime.

Thank you for your answer.
I dont have a specific problem, I am juste looking for a mysql tool to
monitor and see queries the mysql server must execute. The queries printed
by hibernate are usefull, but they dont show the values, only "?" instead...

Regards
Lilian
David Harper - 16 Apr 2005 08:18 GMT
> I use Hibernate in my java project and I know the "show sql" option but it
> doesnt display the entire query. How could I monitor my MySQL server to see
> the queries executed ?

You can enable the query log on your MySQL server by re-starting it with
the --log=logfilename option (or equivalently, "log=logfilename" in your
server configuration file).

All connections and statements will be logged to the file you specify,
in the order that the server received and executes them.

Here's the manual page:

    http://dev.mysql.com/doc/mysql/en/query-log.html

Remember to switch off query logging when it's served its purpose,
because the log file can become very large indeed!

Hope this helps.

David Harper
Cambridge, England
LR - 18 Apr 2005 10:47 GMT
>> I use Hibernate in my java project and I know the "show sql" option but
>> it doesnt display the entire query. How could I monitor my MySQL server
[quoted text clipped - 18 lines]
> David Harper
> Cambridge, England

That is exactly what I was looking for, thank you
Best regards
Lilian


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.