> 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