This question differs from checking if the specific connection is alive or not which I found in SO itself and in Google Search Resutls.
What I want is to check if the mysql connection has already been established. I need to check this, because I have many modules which needs connection to function. The same module is sometimes called where there is no connection and sometimes called when there is already an connection.