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 / November 2005

Tip: Looking for answers? Try searching our database.

query list of connected users to MySQL DB?

Thread view: 
mitchell.ad@neu.edu - 29 Nov 2005 17:06 GMT
Does anyone know how to query the database within a java to display a
list of users who have connections to the database?
David Harper - 29 Nov 2005 20:53 GMT
> Does anyone know how to query the database within a java to display a
> list of users who have connections to the database?

Try executing the query "SHOW PROCESSLIST", as you would using the MySQL
command-line client. You will get a ResultSet which contains the same
information as you see in the command-line client.

Caveat: you need to execute this command as a user with the PROCESS
privilege in order to see all of the other users who are connected to
the database. Otherwise, you see only those server threads that belong
to the same user as the one making the query.

David Harper
Cambridge, England


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.