glynco
asked on
How can I display the IP address of current MySql connections connected?
How can I display the IP address of current MySql connections connected?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Check out http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html
and the help for netstat on your platform
and the help for netstat on your platform
ASKER
Tested but It is not showing the IPs.
import javax.swing.*;
public class NewClass
{
public static void main(String args[])
{
try
{
//Runtime.getRuntime().exec("netstat");
Process p = Runtime.getRuntime().exec("netstat");
JOptionPane.showMessageDialog(null, p);
//System.out.println(p);
}
catch(Exception e) {
System.out.println("Error creating the FileInfo panel: " +
e);
e.printStackTrace();
}
}
}
You won't get the right output like that. Look at the command and its options and how to capture its output stream which is covered at the link i posted
ASKER
I also need to run continuous beep() if there is access to MySql.
:-)
ASKER
Open in new window