Database for getting such things is a very bad idea....
Access this information via MBeans, they can say you everything you need (take a look at /jmx-console of your server). You get access to your MBeans via MBeanServerLocator (JBoss Class)
I know this can be very expensive, but this is to relate some other DB tables for our internal process which can not be done with MBeans, and this is not on regular basis. I will appreciate if I can get the queries for the same.