This week's book giveaway is in the OCAJP forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
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.