How to set a timer in java - Stack Overflow
How to set a Timer say for 2 minutes to try to connect to a database and then exception out if there is any issue in connecting ... Ok, I think I understand your problem now. You can use a Future to try to do something and then timeout after a bit if noth...