Detecting dead connections is an active process. Generally you use Hibernate with a connection pooling library, for example c3p0.
http://forum.hibernate.org/viewtopic.ph ... 84a270020e
In typical usage you configure c3p0 to test the connections periodically, at checkin at checkout or a combination depending on your application need. When c3p0 test the connection it will run a query on it ("select 1" is popular) or use some db specific tester.
Let me know if this helps. It doesn't answer your questions, put it does suggest that you may need to ask a slightly different one...
Marius