I have a requirement to check if the given windows service say "XYZService" is running fine.

I understand that we can issue a "sc query " command and check the status of it, windows command prompt.

but I don't know how to do in java.

I am using JDK1.6 in my application.

appreciate any help.