which database pooling are you using? You need one that detects stale connections and refreshes them. I'm not aware of one offhand, but I know they are out there. (The weblogic pool has been doing it for years)
Arum, If you can't find a connection pool that deals with stale connections, you can handle this yourself.
The first time an application accesses the database, catch any SQLExceptions thrown and try again. Make sure to only try one more time in case the db really is down. This is easy to implement and very portable. Most drivers will realize the connection is stale after trying to use it and get you a new one the second time.