Best way to Check Database connection is alive or not
843859Jun 16 2006 — edited Oct 15 2007HI,
I have java program in which i use some connection with Database.
Before using connection i want to check that Database connection is valid mean , Still connection is alive or not (due to some network failure)
and if its not connected i will try to refresh/reconnect my connection in my progam and after refreshing i will use that connection .
To check that connection is alive i run connectioin.comit() on my connection object.
What is best method to ping or check that connection is valid other then commit(). or this commit() operation is good.
i want some light weight operation by which i know connection is available.
Any good suggestion for auto healing.